Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jason Sung on Dec 17, 2007 18:41
open dhtmlx forum
About get changed cell event

This is question is about dhtmlxgrid pro edition.

Currently I need a function that grid may perform update to database. In my opinion, this action should be triggered by the event onCellChanged(row_id, cell_index, new_data). So I over-write this method and setOnCellChanged(the_function) right before the loadXML method.

But it cause a trouble while loading XML content. Each cell that the loadXML method fill to the cell were treat as "changed cell". I have found all the knowledge base for the solution but can't find.

Would you plz give me some suggestion?
Answer posted by Support on Dec 18, 2007 02:07
This is correct behavior , onCellChanged event called when setting data from XML ( this allow to create custom pre-formating rules )

You can

a) set event only after XML loading
    var mygrid=new...
    ...
    mygrid.loadXML(url,function(){
       mygrid.attachEvent("onCellChanged",function(a,b,c){
             ...custom code here...
        })
    });


b) use onEditCell event , it fires each time cell edited by user
       mygrid.attachEvent("onEditCell ",function(stage,b,c,d,e){
             if (stage==2){ //edit end
             ...custom code here...
             }
             return true;
        })