Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by JC on Jan 17, 2008 09:47
open dhtmlx forum
this.getRowById(row_id).style.fontWeight is NULL

Iam using the follwing code to create xml in asp.net:

Get.aspx.cs:

Response.ContentType = "text/xml";
Response.Write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
Response.Write("<rows>");
Response.Write("<head>");
Response.Write("<beforeInit>");
Response.Write("<call command=\"setSkin\"><param>light</param></call>");
Response.Write("</beforeInit>");
Response.Write("<column width=\"75\" type=\"ro\" align=\"left\" sort=\"str\">Column1</column>");
Response.Write("<column width=\"75\" type=\"co\" align=\"left\" sort=\"str\">Column2");
while (datareader1.Read())
{
Response.Write("<option value=\"" + datareader1[0] + "\">" + datareader1[0] + "</option>");
}
Response.Write("</column>");
Response.Write("<column width=\"75\" type=\"ed\" align=\"left\" sort=\"str\">Column3</column>");
Response.Write("<column width=\"75\" type=\"calendar\" align=\"left\" sort=\"str\">Column4</column>");
Response.Write("<settings>");
Response.Write("<colwidth>px</colwidth>");
Response.Write("</settings>");
Response.Write("</head>");
int i = 0;
while (datareader.Read())
{
Response.Write("<row id=\"" + i + "\">");
Response.Write("<cell type=\"ro\">" + datareader[0] + "</cell>");
Response.Write("<cell type=\"co\">" + datareader[1] + "</cell>");
Response.Write("<cell type=\"ed\">" + datareader[2] + "</cell>");
Response.Write("<cell type=\"calendar\">" + datareader[3] + "</cell>");
Response.Write("</row>");
i = i + 1;
}
Response.Write("</rows>");
Response.End();

Default.aspx: This page contains the grid

mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../codebase/imgs/");
mygrid.preventIECaching(true);
mygrid.init();
mygrid.loadXML("../Get.aspx",function(){mygrid.setColumnHidden(0,true);});
myDataProcessor = new dataProcessor("../Update.aspx");
myDataProcessor.setUpdateMode("off");
myDataProcessor.setTransactionMode("GET");
myDataProcessor.init(mygrid);

When i make changes in to a row the row font turns bold and when i press the update button to send the chanes to the server the changes are being sent but the the row font still remains bold and it gives the following error in the dhtmlxgrid.js file:

Microsoft JScript runtime error: 'this.getRowById(...).style' is null or not an object

How can I change the row font back to normal after the updates are sent to the server???
Can i perform multiple inserts, updates and deletes at the same time before sending the data to the server??
Answer posted by Support on Jan 17, 2008 10:09
Please check the results which returned by "Update.aspx" - it must contain correct action tag with correct sid and tid attributes ( which must be equal to original and updated ID of row )
To check them you can enable debug output by
    myDataProcessor.enableDebug(true)

If correct data returned - row will automatically change to normal state.

>>Can i perform multiple inserts, updates and deletes at the same time before sending the data to the server??
Sure , you can disable auto updates by
    myDataProcessor.setUpdateMode("off");
and later, when necessary, sync all changes at once by
    myDataProcessor.sendData();