Hi,
I have implimented a grid using webservices for client-side binding. I created an additional method that allows me to update rows via the webservice as well. Upon recipt of successful update, the grid is supposed to rebind. This only seems to work if clientside caching is disabled. Is this a bug - or is there a clientside method/property I can call to clear the cache?
Thanks,
Kent
| <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> | |
| <script type="text/javascript"> | |
| function RowSelected(sender, eventArgs) | |
| { | |
| //Enable the update tab | |
| var tabStrip= $find("<%= RadTabStrip1.ClientID %>"); | |
| var tab = tabStrip.findTabByText("Update"); | |
| tab.set_enabled(true); | |
| //Get references to the input fields | |
| var costCenterGID = document.getElementById("<%= costCenterGID.ClientID %>"); | |
| var costCenterNo = $find("<%= costCenterNo.ClientID %>"); | |
| var costCenterDesc = $find("<%= costCenterDesc.ClientID %>"); | |
| costCenterGID.innerHTML = eventArgs.getDataKeyValue("CostCenterGID"); | |
| costCenterNo.set_value(eventArgs.getDataKeyValue("CostCenterNo")); | |
| costCenterDesc.set_value(eventArgs.getDataKeyValue("CostCenterDesc")); | |
| } | |
| function RowUpdate() | |
| { | |
| //Get references to the input fields | |
| var costCenterGIDctrl = document.getElementById("<%= costCenterGID.ClientID %>"); | |
| var costCenterDescctrl = $find("<%= costCenterDesc.ClientID %>"); | |
| //Get the values | |
| var costCenterGID = costCenterGIDctrl.innerHTML; | |
| var costCenterDesc = costCenterDescctrl.get_value(); | |
| //Invoke the webservice to update | |
| Caspr.WebServices.accountingUnitsWebService.UpdateData(costCenterGID, costCenterDesc, UpdateSucceededCallback); | |
| } | |
| function UpdateSucceededCallback(result, eventArgs) | |
| { | |
| alert("Updated? " + result); | |
| if (result) | |
| { | |
| RefreshGrid(); | |
| } | |
| } | |
| function RefreshGrid() | |
| { | |
| var masterTable = $find("<%= auGrid.ClientID %>").get_masterTableView(); | |
| masterTable.rebind(); | |
| } | |
| </script> | |
| </telerik:RadScriptBlock> |
| <ClientSettings> | |
| <DataBinding Location="http://localhost/dnn/DesktopModules/Caspr/Webservices/accountingUnitsWebService.asmx" | |
| SelectMethod="GetData" | |
| CountPropertyName="Count" | |
| DataPropertyName="Data" | |
| FilterParameterType="Linq" | |
| SortParameterType="Linq" | |
| EnableCaching="true" /> | |
| <Selecting AllowRowSelect="true" /> | |
| <ClientEvents | |
| OnRowSelected="RowSelected" | |
| /> | |
| </ClientSettings> |