EasyUI Forum
May 09, 2024, 04:21:41 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: Disable editors for specific rows (datagrid)  (Read 9724 times)
A-K
Full Member
***
Posts: 122


View Profile WWW
« on: August 13, 2014, 02:40:51 PM »

Hey, is it possible to make some columns in specific rows editable and some not?
When you build the columns you define the editors which makes all of the rows under that column
to be available for edit, But I need that in some rows some columns will not have editors in them.

Thanks, Alon.
« Last Edit: August 13, 2014, 02:42:43 PM by AlonKatz » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: August 13, 2014, 10:36:47 PM »

You can specify the column editor before editing a row. Please try the code below:
Code:
$('#dg').datagrid({
    onBeforeEdit: function(index,row){
        var col = $(this).datagrid('getColumnOption', 'itemid');
        if (some condition){
            col.editor = 'text';
        } else {
            col.editor = null;
        }
    }
})
Logged
A-K
Full Member
***
Posts: 122


View Profile WWW
« Reply #2 on: August 14, 2014, 08:51:39 AM »

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