WebGrid 7 : Persisting changes by javascript

3 replies. Last post: February 18, 2010 5:58 AM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Michael CMember

Hi,

I'm having problem persisting grid changes by javascript.

The grid settings are Paged Hierarchical grid having Invoice and InvoiceDetails as parent and child relationship and using batchupdate feature. The grid is populated during WebGrid1_InitializeDataSource by a dataset which contains 2 tables: Invoice and Invoicedetails with a datarelation.

When an invoice is selected (by rowchecker checkbox) , I have some javascript code that iterates through its invoicedetails and select all of them and apply payment against the outstanding amount. When the rowchecker in the invoice header is checked, it applies payment against all invoices and their invoicedetails i.e to every invoices.

The goal is to give the client the possibility to choose which combination of invoice he wants to pay, they can essentially try different combinations.

All the changes are reflected in the grid. Only when the update button is clicked, the process will gather all the selected invoice details and actually pays them.

Problems:

1. When I click on the update button which trigger a postback, all the changes made on the grid are not reflected on the server side. Is there a way to persist changes made by javascript to the cached datasource without triggering postback or flypostback? I tried wgGetCellByName(childRows[i].GetElement(), "Payments").cellModified = true; with ISGetObject("WebGrid1").MarkEdit(); to no avail.


2. When navigating to the next paged items (Page 2) then back to (page 1), you can no longer expand or collapse the parent item. Child rows are not shown. When RestoreExpandedChildRows="True" is used, the parent item that was expanded remain expanded, but other rows cannot be expanded.

3. Rowchecker does not seem to work on other pages (Page 2, 3, 4 ...) other than the current page.

We are trying to gather all the changes made on the screen before making a server call. Is this even possible using Webgrid, if so please, any advice will be appreciated.


Thanks

Michael

All times are GMT -5. The time now is 10:17 AM.
Previous Next