Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Phil on Mar 18, 2009 05:48
open dhtmlx forum
dhtmlxConnector with dhtmlxGrid

Hello,

When i populate a grid with a connector, is it possible to add a column (at first position) for each row. This column is not a database field, but contain a fixed image or icon.

Thanks in advance

Phil
Answer posted by Support on Mar 18, 2009 10:30
It possible
in case of render_sql
        $grid->render_sql("SELECT 'some value' as item_custom, item_nm,item_cd FROM grid50000","item_id","item_custom,item_nm,item_cd");
in case of render_table
        $grid->render_table("grid50000","item_id","'some value'(item_custom),item_nm,item_cd");

If you need to have value different for different row, you can use beforeRender server side event to customize it

Beware that, if you still want to use auto-generated quieries for data saving  you will need to assign custom code to beforeProcessing event and use  remove_field method of DataAction to ignore pseudo-field (item_custom)