iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
We are currently in the process of upgrading our old WebGrid 3.5 to the latest version.
We would need to replace obsolete syntax with the current one. Do you have a document which would give the oldand new syntax.
One example is the client side javascript code "wgPrepareUpdateRow".
What would be the equivalent to Webgrid 9.
Thanks
Do you have a document which would give the old and new syntax?
I found these two articles in WebGrid documentation:
One example is the client side JavaScript code "wgPrepareUpdateRow"
Unfortunately, I can't help you by informing the new client-side API of wgPrepareUpdateRow. Could you please inform me about the usage of this method? or provide a simple sample which uses this method? Maybe I can start from this point to find the current one.
Hi Yudi,
I was aware of the 2 articles but as you alread know they do not explain what "wgPrepareUpdateRow" is doing or what it should be replaced by.
It is used when the user saves the new row.
This is the javascript function:
function SavePage(){var grid = wgGetGridById("wgrdABCD");if (grid.getSelectedObject() != null){var rowElm = grid.getSelectedObject().getRowElement();var cell = grid.getActiveEditCell(); wgHighlightEditCell(cell);cell.cellModified = true;wgHighlightRow(rowElm); wgPrepareUpdateRow(grid);return true;}}
This is what the 3.5 document says about wgPrepareUpdateRow:
// invokeUpdateRow event at the server side // and also refresh griddata display at the client side wgPrepareUpdateRow(grid);
I tried to replace to code with:
var grid = ISGetObject('wgrdABCD');var row = grid.GetSelectedObject().GetRowObject();row.Update();
I would assume row.Update() would trigger the server side event
Private Sub wgrdABCD_UpdateRow(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.RowEventArgs) Handles wgrdLHSC.UpdateRow
But UpdateRow is not called.
Any idea?
Apologize for the delay in sending this.
I created a simple sample of WebGrid. The grid has OnAddRow, OnDeleteRow, OnInitializeDataSource, and OnUpdateRow event handlers which will handles the query of add, delete, select, and update respectively.
Within the page, a button is added. This button will do the following:
The whole action is done using onclick of the button (see snippet code below).
<input id="button1" type="button" value="Select First Row and Update" onclick="EditFirstRow()" /> <script type="text/javascript"> function EditFirstRow() { var grid = ISGetObject("WebGrid1"); var row = grid.RootTable.GetRow(0); // get the first row in RootTable var cells = row.GetCells(); // get WebGridCell collection row.Select(); // select the row // populate new row object cells.GetNamedItem("CustomerID").SetText("INTER", true); cells.GetNamedItem("CompanyName").SetText("Intersoft Solutions", true); ... row.Update(); // insert new record return true; } </script>
Update() method will invoke OnUpdateRow event at the server side. I enclosed my simple sample for your reference.
Please have the sample evaluated on your end and let me know if you have different result.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname