Access the Current Table Data in Client Side (v2024)

I want to retrieve the data of the Current List Page, especially the Current Table, in the JavaScript (Startup Client) section for specific purposes, such as drawing a custom chart. One way is to read the current page data on the server side and store it in variable with "SetClientVar", then read it in the client-side (JavaScript). My questions are:

  1. On the server side, in which function should I read the data? For example "pageLoad()" or " recordsetSelected($rs)" or another function?

  2. Which function should I use to read the Current page and table data?

  3. Instead of this method (storing data on the server and reading it on the client), is there a better approach?" for example phpmaker's client-side function ?

  1. If you only want to use the current page data to draw chart, you may setup charts in the List page directly.

  2. If you want to result set, you may try Page_Render server event, e.g.

    SetClientVar("myData", $this->getRowsFromEntities($this->Records)); // v2026
    
  3. If you want to replace the original page content, you better use Custom Template, then you may get the rows by JavaScript ew.templateData.rows.

1 Like

Thank you for your attention, but I am using version 2024. Is there a solution available for this version?

You still can use 1. and 3. with v2024.