Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Sep 18, 2009 00:20
open dhtmlx forum
Editable Grid

Hi to all,

im using dhtmlxgrid v.2.5 Standard Edition im creating editable grid i successfully updated one r more rows using setTransactionMode("POST",true)

mygrid = new dhtmlXGridObject('mygrid_container');
mygrid.setImagePath("imgs/");
var flds = " ,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q";
mygrid.setHeader(flds);
mygrid.setInitWidths("100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100")
mygrid.setColTypes("cntr,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,calendar,calendar");
mygrid.setColumnIds("rowNo,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q")
mygrid.setSkin("modern");
mygrid.setColSorting("na,str,str,str,str,str,str,str,str,str,str,str,str,str,str,str,date,date")
mygrid.init();
mygrid.loadXML("ReadExcelSheet?sheetNo="+idn);

tabbar.setContent(idn,"mygrid_container");
    
myDataProcessor = new dataProcessor("Sample?sheetNo="+idn);
myDataProcessor.setUpdateMode("off");//available values: cell (default), row, off
myDataProcessor.setTransactionMode("POST",true);

myDataProcessor.defineAction("update", function my_handler(xml_node)
{
mygrid.clearAndLoad("ReadExcelSheet?sheetNo="+idn);
return true;
});

in this defineAction update i just clear data and load data from the server.

my problem is again i try to update the grid its not updating nothing can be sent to the server

Plz guide me

Thanking You
Answer posted on Sep 18, 2009 00:34
>>my problem is again i try to update the grid its not updating nothing can be sent to the server
The dataprocessor detects the row changed only by edit operations. If a row was changed by a direct API calling it will not be updated. You can manually call the dataprocessor to inform about the update operation:
dp.setUpdated(id,true);

If you want to mark row with status different from “updated” (not sure how it can be useful, but still ) it can be done as below:
dp.setUpdated(id,true,"status name");
here id - row id