Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Sachin on Feb 04, 2009 06:56
open dhtmlx forum
disable check box in grid.. does not get disabled

I have this function to diable the check box in the gri.. the check box is the 4th column
function disableWelcomeEmailChk(name) {
    //alert("disableWelcomeEmailChk : " + name);
    for ( var i = 0; i < grid.getRowsNum(); i++ ) {
        if ( grid.getRowId(i) != null ){            
            grid.cellByIndex(i,3).setDisabled(true);        
        }
    }

}

But even after the grid is populated the check box column is not disable. When I put the alert message it gets disabled. so thef ucntion seems to work..it as if the grid is not populated when the function is initially called. the grid gets poplulated via ajax call

Thanks
Answer posted by Support on Feb 04, 2009 07:28

The grid loading is async. so you need to call any methods which will operate with data, only after data loaded in grid

It can be done with onXLE event or by using second parameter of load command

grid.load(url,function(){
           disableWelcomeEmailChk();
});