jQuery EasyUI Forum
June 17, 2013, 10:13:39 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: Readonly row in propertygrid  (Read 1737 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: 697


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
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!