Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Chuan on Jul 31, 2007 20:19
open dhtmlx forum
Where should we put serialize()

We have suffered some problem when I serialize the grid to XML.


mygrid = new dhtmlXGridObject('gridbox');
    
    
    mygrid.setSkin("modern");
    mygrid.setImagePath("imgs/");
    mygrid.setHeader("<%=session("registerfieldlist")%>");
    mygrid.setInitWidths("<%=session("cwlist")%>")
    mygrid.setColAlign("left,left,left,left,left,left,left,left,left,left")
    mygrid.setColTypes("link,txt,txt,txt,txt,calendar,txt,txt,txt,txt");
    mygrid.setColSorting("str,str,str,str,str,str,str,str,str,str")
    mygrid.enableLightMouseNavigation(true);
    mygrid.setOnEditCellHandler(doOnCellEdit);
    
        
    function doOnCellEdit(stage,rowId,cellInd){
        if(stage==0){
            alert("User starting cell editing: row id is"+rowId+", cell index is "+cellInd)
        }else if(stage==1){
            alert("Cell editor opened");
        }else if(stage==2){
            
var myXmlStr = mygrid.serialize();
    myXmlStr.setSerializationLevel(false,false,false,false,true)
mygrid.loadXML("xml/xmlgrid.xml");

                    }
        return true;
    }
    
mygrid.init();
    mygrid.loadXML("xml/xmlgrid.xml");
    
    

We want to do the serialize inside setOnEditCellHandler(stage==2), but mygrid which is the object of the new grid can not be identified inside this function. Should we put serialize function outside?

Many thanks

Chuan Shen
Answer posted by sematik (Support) on Dec 01, 2014 05:22

Not much can be said in addition to the reply above, but you also can check button a href and rich internet application and find out what we have probably missed in our explanation.