Update cell in a grid Grid using Dataprocessor passing sub_r

Hi All.

Love your product.

Have a trial version atm, but have put in the req for the commercial purchase, will be approved shortly.

I am trying to get my new grids going.

I am using ASP and msSQL server.

Samples of code and initialisation at the bottom of this text.

Trial application ##############.com Login “#####” password “#####”.
in the html string in the top of the browser change the word “ASPENv2” to read “ASPENv4” keep the rest of the HTML string the same.

Click on all open and pending in the tree…

Notice the lovely + brings up the notes that are in the text of the XML as the sub grid elements.

When I edit a cell (Note that dp.setUpdateMode(“cell”) is set) it sends the following form information to the server.

(See bit 1)

Which seems to blow up my data reader on the server.

Can I tell it not to send the sub_row information?

Regards
Bruce

Bit 1
--------------


Name=“gr_id” value=“46”
Name=“gTable” value=“tblJobs”
Name=“f:Address” value=“Administration for Unisof”
Name=“sub_row” value="




Bruce Lock
Thu 18 Jun 2009 3:09PM




To:johns@unisoft.com.au cc: bcc:
-------------------------------------------
Hi John.

FYI - Jobs created, closed and managed by week and by category over the pat few weeks.

Rgds
Bruce





Bruce Lock
Thu 25 Jun 2009 9:31AM




To:johns@unisoft.com.au cc:Judi@unisoft.com.au;Frankie@unisoft.com.au;mitul.patel@numarasoftware.com.au;block@automatesolutions.com;techsupp@unisoft.com.au bcc:
-------------------------------------------
Hi All.

I have switched off the thing that automatically puts the client email address into the to line.

This will prevent any more accidental client emails.

Regards
Bruce

"
Name="!nativeeditor_status" value=“updated"




Grid in a layout
----------------------
//Main Grid
dhxGrid = dhxLayout.cells(“b”).attachGrid();
dhxGrid.attachEvent(“onRowSelect”,doOnRowSelected);
dhxGrid.setImagePath(”./imgs/");
dhxGrid.init();

I am using sub rows refer to xml sample at bottom.
----------------------

I am also using a dataprocessor to update cell edits.
----------------
//Now set up the editable grid.
dp = new dataProcessor("./Engine/updGrid(test).asp?CompanyID=<%=CompanyID%>&SID=<%=session.sessionID%>")
dp.init(dhxGrid)
dp.enableDataNames(true);
dp.enablePartialDataSend(true);
dp.setUpdateMode(“cell”);
dp.defineAction(“error”, dpError);
dp.defineAction(“error”, dpDebug);
//specify transaction method - POST or GET (default is GET)
dp.setTransactionMode(“POST”);


xml sample
---------------



E
D
Issue No
Fault
Next Date
Client
Next Action



Rep

Tony Zdraveski
Bruce Lock
Mitul Patel
Frankie Dib
Judi Baker
Annie Harper
John Sestan

Contact
CPhone


Stage


New Issue
Assigned
Suspended
Invoiced
Complete



Status

Open
Closed
Pending

Inv






,#select_filter,#text_filter,#select_filter,#select_filter,#text_filter,#text_filter,#text_filter,#text_filter,#select_filter,#select_filter,






frmJob.asp?CompanyID=42&JobID=1
tblJobs






Bruce Lock
Thu 14 May 2009 3:38PM




Received Machines.





Tony Zdraveski
Thu 14 May 2009 3:45PM





------------
From: Annie Harper [annieh@unisoft.com.au]
Sent: Wednesday, 6 May 2009 4:17 PM
To: johns@unisoft.com.au





Bruce Lock
Yesterday 10:11AM




Hi All.

There is something seriously wrong with the set up with Apollo and or the phone lines.

The phone lines seem to have gone very quiet and the modems are not detecting dial tone.

Well the US robotics ones are.

The server is also throwing up random SCSI block errors (not a good sign).

And is coming back with interrupt device errors, also not a good sign.

Further frustrating diagnosis is the fact that if I knock the main server, it sometimes reboots, this is quickly followed by cries of dismay from Frankie and Judi.

Therefore I have to be very careful in trying to work on Apollo.

So I have set up a dial up modem connected to powerterm on the support PC and showed Judi how to use it.

Tony and I will need to look into what�s set up, there are at least four different modems onto different phone lines with different combinations of set ups for the connect script.

Therefore the system will need to stay on the support PC until we get a chance to do some more diagnosis.

Hopefully without effecting the main server.

We will look into it tomorrow.

Regards
Bruce





Bruce Lock
Yesterday 11:34AM




Managed to get fax out working.

Server still coming up with errors in interrupts.

Seems to be working though.







056
Outbound modem not working
27 Jun 2009
Unisoft

Mitul Patel


New Issue
Open
0

SubRow data is stored in the same way as row related user-data ( actually it can be retrieved as grid.getUserData(rowId, “sub_row”); ) and as other row’s related user-data - it will be sent to server during data sending.
Technically it must not break POST data sending, but if it causes problems in your case - please try to use attached dhtmlxdataprocessor.js instead of original one. It is updated to ignore sub_row data , and to not include it in data request.

dhtmlxdataprocessor.zip (5.09 KB)

Actually you were right.

The problem was my broken server data connector, but thank for the quick reply.

Can I turn that option off using a switch?

Whilst I appreciate the rapid response, I wish to stick with the standard libraries for the purposes of longer term maintenance.

Regards

Your XML snippet contains some other userdata info, is it necessary for server side operations? or removing all user-data from server side request will work for you?


Actually now is a pertinent time to ask for your advice before I pursue too far down the wrong chanels.



The general techniques I am using is to put the URL’s into the UserData in the trees and grids, as I re-use the components for different functions.



Is that the best way to go?



For example in the case of the grid, I have two pieces of user data, gURL and gTable.



I use gURL to pass through to the onrowclick event that in turn passes it to the attachURL event for the bottom panel of my layout control.



I use the same grid in section b of my layout control to display a number of different layouts, jobs, opportunities, emails, projects, reports, etc



These are loaded using the onclick even on a tree control, which I use the same technique, I load the source XML URL into the userdata for the tree control, then pass that to the on click event for re-loading the main grid.



I use the gTable userdata to pass through to my dataprocessor handler, as I use the same control for multiple uses (tables), so I need to identify what I am using it for.



You will note that I am storing the table field name in the heading information in the XML string with f:

 to indicate a direct updateable field.



(f:username for example is the field “username” in the current save table indicated by the gTable variable.)



I could just as easily use a two part heading id that had the table and the field name in it (f::
) and use the loverly split funtion to load the data up into an array.



Or even use a reference back to the tree grid to see whats selected and then use that to determine the c cell layout URL on the grid rowclick event.



Or even (if I cant use sub_row in conjunction with grouping on the grid) resort to loading up a right click menu on the grid and having people chose open something before displaying the bottom panel.



However that means changing the right click menu for every re-load of the grid.



Which I assume I can do in the on row click even function section (see functions below).



So…



What do you guys use when deploying the component for your own projects?



Regards



------ Code Snipets



function doOnTreeClick(id) {



//var jDebugMode = 1;



//if (jDebugMode == 1) alert(dhxTree.getUserData(id, “gURL”) + “&SID=<%=session.sessionID%>&D=<%=Now%>”);



if (dhxTree.getUserData(id, “gURL”) != ‘None’) {



LoadGrid(dhxTree.getUserData(id, “gURL”), dhxTree.getUserData(id, “gOpt”));



LoadStatusWindow(dhxTree.getUserData(id, “gOpt”));



};



};



function doOnRowSelected(id) {



dhxLayout.cells(“c”).attachURL(dhxGrid.getUserData(id, ‘gURL’));



};



function LoadGrid(iURL,iCookie) {



var iDate = new Date();



var iTime = iDate.getTime();



//if (jDebugMode == 1) alert(iURL + “&SID=<%=session.sessionID%>&D=” + iTime);



if (cur_Grid != iURL) {



cur_Grid = iURL;



if (jDebugMode == 1) {



dhxStatus.setText(iURL + “&SID=<%=session.sessionID%>&D=” + iTime);



alert(iURL + “&SID=<%=session.sessionID%>&D=” + iTime);



} else {



dhxStatus.setText(“Loading Data From Server…”);



};



dhxGrid.enableAutoSizeSaving(iCookie); //enable automatic saving width



dhxGrid.loadXML(iURL + “&SID=<%=session.sessionID%>&D=” + iTime, function() {



dhxGrid.loadSizeFromCookie(iCookie);



if (jDebugMode != 1) {dhxStatus.setText(“Loading Complete”)};



});



};



};


Um sorry, I didnt answer the question.



Yes I can remove all userdata if required.



Regards

I use gURL to pass through to the onrowclick event
It is common approach, and actually is main purpose of user-data functionality .

>>I use the gTable userdata to pass through to my dataprocessor handler
This kind is a bit more tricky - by using js debug plugins, user will be able to alter user-data and, as result, change the logic of server side actions.
If you sure that such possibility doesn’t introduce security problems in your case - there is no any other problems with such approach.

>>What do you guys use when deploying the component for your own projects?
Using userdata for exta information related to the row - is a normal approach, just beware that user will be able change such data, so its not a good place for private data.
Starting from grid 1.6 - it is possible to store extra info in row attributes, but it has not any significant advantages except of smaller xml size.



Updated dthmlxdataprocessor.js and dhtmlxgrid_excell_sub_row.js are sent by email.
Similar changes will be introduced in next version of the grid.


I use the gTable userdata to pass through to my dataprocessor handler
>This
kind is a bit more tricky - by using js debug plugins, user will be
able to alter user-data and, as result, change the logic of server side
actions. 
>If you sure that such possibility doesn’t introduce
security problems in your case - there is no any other problems with
such approach.

Ahh yes, good point, field is fine, table is not.

I should also make sure I strip off any sub query related text to ensure I avoid SQL injection type of attacks.

Regards