Using render_sql() or render_table() you can assign aliases to required tables or columns. To do this, in sql statement you should use word 'as' (as in any usual sql statement), in other parameters - parentheses.
$grid->render_table("tableA","id","name,price(product_price)"); //or $grid->render_sql("Select *,tableA.id as aid from tableA, tableB where tableA.id=tableB.id", "tableA.id(aid)","name,price(product_price)");
To attach event you should use event→attach(). For more details of this topic, see 'Event handling' quide.
$conn->event->attach(event_name,handlerFunc);
Using get_value() method you can check value of any item.
$grid->get_value($name);
By default, connector allows all operations. To deny some operation use deny(name_of_operation) method that can get one of the following:read/update/insert/delete. For more details see 'Security' guide.
$conn->access->deny("update");
You have 3 ways to filter data on server backend:
grid.load("some.php?connector=true&dhx_filter[1]=mask");
mygrid.setHeader("Column A, Column B"); mygrid.attachHeader("#connector_text_filter,#connector_select_filter")
function custom_filter($data){ ... } $conn->event->attach("beforeRender","custom_filter");
See the guide 'Filtration' for more information.
You can enable logging using enable_log() method. For more details see 'Error handling and logging' guide.
$conn->enable_log("path to log file");// to show short info on client-side //or $conn->enable_log("path to log file", true);// to show full info on client-side
Using set_value() method, you can set value to any item of component.
$dataItem->set_value($name,$value)
You have 2 ways to sort data on server backend:
grid.load("some.php?connector=true&dhx_sort[2]=asc");
grid.setColSorting("connector,str,na);
See the guide 'Sorting' for more information.
dataProcessor lets you validate data on client-side. Use setVerificator(index,method) method to define the appropriate columns and validators. See details in the related chapter of dataProcessor' documentation.
dp.setVerificator(column_index,verification_func)
To perform server-side validation you should use one of the dhtmlxConnector events stated below and specify the needed validation rules in the appropriate events' handlers functions:
function validate($data){ ... } $conn->event->attach("beforeProcessing","validate");
For more details of server-side validation, see guide 'Validation'.