EasyUI Forum
October 18, 2025, 09:06:16 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: some fields readonly only if existing row  (Read 5279 times)
markalves
Newbie
*
Posts: 15


View Profile
« on: April 19, 2020, 10:13:58 AM »

Hi I would like to set some fields readonly only if editing existing row:

Existing rows I want to make readonly have a colum set to 9, I made in this way:

onBeforeEdit: function(index,row){
            var col = $(this).edatagrid('getColumnOption', 'qta');
            alert(getSelectedValue('#dg3', 3))
            if(   getSelectedValue('#dg3', 3) == 9) {
               col.editor = null;
            } else {
                col.editor = 'text';
            }
            }

It works but if after editing these rows then I add a new row selectedvalue remain to 9 and it remain readonly.
Is there a way to verify if new row or after editing clear buffer ?
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!