To enable dynamic loading you should:
grid.enableSmartRendering(mode,buffer);
conn.dynamic_loading(rowsNum);
See the guide 'Dynamic loading' for more information.
To set some specific formatting or change data before sending to the client side, you should use the beforeRender event handler. For more details on this topic, see the 'Formatting/Changing Data before Loading' chapter.
class RenderBehavior extends ConnectorBehavior{
public void beforeRender(DataItem data) {
if (data->get_index() % 2 == 1 )
data.set_row_color("red");
}
}
grid.event.attach(new RenderBehavior());
To load data from a database table you should use one of two methods:
grid.render_table("grid50","item_id","item_nm,item_cd", "extra1, extra2");
grid.render_sql(
"SELECT * from tableA INNER JOIN tableB ON tableA.id=tableB.id",
"",
"name,price",
"extra1, extra2"
);
To send to the client side additional information that won't be outputted, but you'll have access to, use the fourth(optional) parameter of the render_table() method. There you should specify columns that contain the desired additional information.
grid.render_table("some_table","id","name,price","color,count");
For more information, see the chapter 'Using extra fields' in the 'Formatting/Changing Data before Loading' guide.
Back to top