EasyUI Forum
May 17, 2024, 09:03:41 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Readonly row in propertygrid  (Read 12046 times)
esteen
Newbie
*
Posts: 5


View Profile Email
« on: June 11, 2012, 12:39:17 PM »

I would like to use the propertygrid component. However, not all the properties I want to display are mutable. How can I specify that a certain property is readonly.
I have tried to configure an empty editor, but this gives a javascript error:

Error: $(this).datagrid("getEditors", _57b)[0] is undefined
Source File: https://localhost:8443/IntakeBE/include/scripts/jquery-easyui/jquery.easyui.min.js
Line: 7680
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 12, 2012, 12:48:43 AM »

Disable a row editing is not allowed in current version. This issue will be solved in next release version. The simple way to solve this issue is to define an 'empty' editor that do nothing when clicking a row. Assigning the row editor type to 'empty' type will prevent the row from editing. The 'empty' editor is defined as:
Code:
$.fn.datagrid.defaults.editors.empty = {
init: function(container, options){
return $('<div style="padding:0 4px"></div>').appendTo(container);
},
getValue: function(target){
return $(target).html();
},
setValue: function(target, value){
$(target).html(value);
}
};
Logged
esteen
Newbie
*
Posts: 5


View Profile Email
« Reply #2 on: June 12, 2012, 11:33:20 AM »

Thanks, this solves our problem. When you implement this for the next version, it would be nice to have the possibility for a different styling for a read-only property (greyed out or italic..)
Logged
JeroenNL
Newbie
*
Posts: 37


View Profile
« Reply #3 on: May 03, 2014, 12:22:15 AM »

Is disabling a row possible in the current version? I couldn't figure out how.

If not, where do I put that code which defines an 'empty' editor? I shouldn't put it in the jquery.easyui.min.js file, should I?

Finally, if I just want to disable the entire propertygrid (just use it to show some values, but not allow the user to alter them), what would be the best way to accomplish that?
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!