EasyUI Forum

General Category => General Discussion => Topic started by: codeguyross on November 19, 2013, 12:53:31 PM



Title: easyui-propertygrid adding data at runtime and data-options property
Post by: codeguyross on November 19, 2013, 12:53:31 PM
Hello all,

I have two questions about the property grid.

I would like to know how to add data to easyui-propertygrid at runtime. I also need to know the available data-options for the easyui-propertygrid.

Thanks for the help!,

Codeguyross


Title: Re: easyui-propertygrid adding data at runtime and data-options property
Post by: stworthy on November 19, 2013, 05:28:14 PM
All the properties of propertygrid and its dependent properties can be declared in 'data-options' attribute. To add a new row to propertygrid, call 'appendRow' or 'insertRow' methods. If the 'showGroup' property is set to true, be sure to re-group rows again. The code below shows how to append a new row to a specified group.
Code:
var pg = $('#pg');
pg.propertygrid('appendRow',{name:'n11',value:'v12',editor:'text',group:'ID Settings'});
var data = pg.propertygrid('getData');
pg.propertygrid('loadData', data);


Title: Re: easyui-propertygrid adding data at runtime and data-options property
Post by: codeguyross on November 20, 2013, 12:43:49 PM
All the properties of propertygrid and its dependent properties can be declared in 'data-options' attribute. To add a new row to propertygrid, call 'appendRow' or 'insertRow' methods. If the 'showGroup' property is set to true, be sure to re-group rows again. The code below shows how to append a new row to a specified group.
Code:
var pg = $('#pg');
pg.propertygrid('appendRow',{name:'n11',value:'v12',editor:'text',group:'ID Settings'});
var data = pg.propertygrid('getData');
pg.propertygrid('loadData', data);

This was perfect! Thanks for the help stworthy!