How to get row data in preOpen event

How to get row data in preOpen event

JustinPMacCreeryJustinPMacCreery Posts: 2Questions: 1Answers: 0
edited May 2022 in Free community support
editor.on('preOpen', function(e, mode, action){
        var d = price_table.row( editor.modifier().row ).data()
        if(d[0]['locked'] == '1'){
            return false;
        }
        return true; 
    });

To determine whether or not a row is editable, in the row data there's a key for 'locked' and it's set to true ('1'), editing the field should be disabled. However, d = price_table.row( editor.modifier().row ).data() leaves d = null. How do I get the row data at this point?

Answers

  • JustinPMacCreeryJustinPMacCreery Posts: 2Questions: 1Answers: 0
    edited May 2022

    Got it:

        editor.on('preOpen', function(e, mode, action){
            var d = editor.get()
            try{
                if(d['locked'] == '1'){
                    return false;
                }
            }catch(e){
                console.log('---UNDEFINED---'); 
            }
            console.log(d[0]); 
            return true; 
        }); 
    
    
Sign In or Register to comment.