Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by block on Jul 06, 2009 06:07
open dhtmlx forum
debugging the data connector

Hi All.

I have a grid and a dataprocessor as below.

And it works, as my ASP/SQL server code sends back update ack's etc.

However in order to debug the server module, I have been using a updGrid(test) script that just spurts out the form items, then pasting the modules into a new form, then running that form against the server, which all takes a fair bit of time.

Is there a debug switch where the dp will show you what it is getting back? including the helpful little things about which line the syntax errors are on? Whithout having to resort to simulating what is being sent in another form?

Regards

-----
ASP form to generate test code:

<data>
<action type="error" tid="1" sid="1"><![CDATA[
<html>
<body>
<form id="form1" runat="server" action="engine/updGrid.asp?CompanyID=42&SID=<%=session.sessionID%>" method="post">
<%

For Each x In Request.Form
<input type="hidden" Name="<%=x%>" value="<%=request.form(x)%>" />
<%next%>
<input type="submit" value="Press me!" />
</form>
</body>
</html>]]></action>
</data>

Main form object set up:
---------------------------------------------

dhxGrid = dhxLayout.cells("b").attachGrid();
dhxGrid.attachEvent("onRowSelect", doOnRowSelected);
dhxGrid.setImagePath("./imgs/");
dhxGrid.setDateFormat("%d %b %Y");
dhxGrid.enableAutoSizeSaving("frm_LoggedIn", "expires=" + iDate.toUTCString()); //enable automatic saving width
dhxGrid.init();

dp = new dataProcessor("/ASPv2/engine/updGrid.asp?CompanyID=<%=CompanyID%>&SID=<%=session.sessionID%>")
//alert("<%=request.servervariables("Server_Name")%>/ASPv2/engine/updGrid.asp?CompanyID=<%=CompanyID%>&SID=<%=session.sessionID%>&D=" + iTime);
dp.init(dhxGrid)
dp.enableDataNames(true);
dp.enablePartialDataSend(true);
dp.setUpdateMode("cell");
dp.defineAction("error", dpError);
dp.defineAction("debug", dpDebug);
dp.setTransactionMode("POST");
}

function dpError(obj) {
alert("Error occured.\n" + obj.firstChild.nodeValue);
dp.stopOnError = true;
return false;
}

function dpDebug(obj) {
if (jDebugMode == 1) alert("Debug Text.\n" + obj.firstChild.nodeValue);
}
Answer posted by dhxSupport on Jul 06, 2009 07:56
The only availibe dataProcessor debug file is dhtmlxdataprocessor_debug.js which you can find at the dhtmlxDataProcessor package.