EasyUI Forum

General Category => General Discussion => Topic started by: codeguyross on November 20, 2013, 02:15:20 PM



Title: How do I make a non Editable easyui-propertygrid
Post by: codeguyross on November 20, 2013, 02:15:20 PM
Hello,

How do I remove the ability for the user to be able to edit the columns in the easyui-propertygrid?

Thanks!


Title: Re: How do I make a non Editable easyui-propertygrid
Post by: stworthy on November 20, 2013, 05:08:55 PM
To disable editing on propertygrid, remove the 'editor' property for specified rows. The code below renames 'editor' to 'editor1'.
Code:
var rows = $('#pg').propertygrid('getRows');
for(var i=0; i<rows.length; i++){
rows[i]['editor1'] = rows[i]['editor']
rows[i]['editor'] = undefined;
}
To restore editing feature, just rename 'editor1' to 'editor'.
Code:
var rows = $('#pg').propertygrid('getRows');
for(var i=0; i<rows.length; i++){
rows[i]['editor'] = rows[i]['editor1']
}


Title: Re: How do I make a non Editable easyui-propertygrid
Post by: codeguyross on November 21, 2013, 09:40:14 AM
Thanks again stworthy!