How to load data table with server function

This tutorial shows you how to use Server function as Data source type in data table component. In our example we have page for products, and on first form of that page we will show data table of all products.

Datatable sql example

1. Login into developer panel.

2. Navigate to Pages menu item.

3. Select page pageProduct.

4. Drag and drop Data table component from all components list to formDatatableProduct. 

Server function with data table

5. Click on Data source Function field and on the left side of dialog window choose plugin. On the right side choose function. Selected function should return AjaxProxy class which attribute data should be an array with data and rowNum keys (i.e. $result->data[“data”]= array(array(“Id” =>”1″, “Name” => “Product 1”)); $result->data[“rowNum”] = 1;) or just an array with data and rowNum keys. Click on Save button.

Server function

6. Click on Save changes, go into your application and check out the results.