EasyUI Forum
May 04, 2024, 01:50:04 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: easyui-propertygrid adding data at runtime and data-options property  (Read 14418 times)
codeguyross
Newbie
*
Posts: 15


View Profile Email
« 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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);
Logged
codeguyross
Newbie
*
Posts: 15


View Profile Email
« Reply #2 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!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!