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,
I have a grid with a single updatable field and a read-only computed field. Everytime you edit the first field the read-only one should change (we need to do a DB call to re-calculate it according to whatever you just updated on the first). A refresh is needed for this, since I'm using an ObjectDataSource, I'm doing that onUpdated.
My problem is... if you keep spamming changes/edits during that extra refresh the grid crashes. You can simulate this by modifying the BindToCustomObject sample in the R2 samples solution. Add on the ODS:
OnUpdated="RefreshGrid"
And on the Codebehind file:
protected void RefreshGrid(object sender, ObjectDataSourceStatusEventArgs e) { WebGrid1.ClientAction.Refresh(); }
And try spamming changes on the region field... Is there a way to lock the grid during this flypostback to prevent this from happening? Or to prevent the users from spamming changes?
I'm using WebGrid 7.0.7200.401 and IE7
Thanks
Hi Glenn,
Yeah, I tried that as well... while it's true that it prevents you from interacting with the grid while the hourglass is displayed it doesn't quite cover the solution for spamming edits, you can still make the grid crash.
Is there no way to disable the grid while refreshing?
Regards
I assume that the goal is to avoid user from spamming changes on WebGrid during ‘Refresh’. Well, please allow me to offer you a trick for this scenario.
The idea is very simple. I have a div tag that has same dimension (width and height) with WebGrid. During WebGrid refresh, I simply set the z-index style of the div to a value that higher than the value of z-index of WebGrid. Practically, the div will be on top of WebGrid during refresh and will bring back WebGrid on top after WebGrid finish refresh.
We can utilize OnBeforeRequest and OnAfterResponseProcess client side event to set the z-index. Below is the snippet code of the page and the script.
Page code:
<div id="div1" style="height: 250px; width: 500px; position: absolute; background-color: #E5EECC; filter: alpha(opacity=50); -moz-opacity: 0.5; opacity: 0.5"> </div> <ISWebGrid:WebGrid ID="WebGrid1" runat="server" DataSourceID="AccessDataSource1" Height="250px" UseDefaultStyle="True" Width="500px"> <LayoutSettings AllowAddNew="Yes" AllowDelete="Yes" AllowEdit="Yes"> <ClientSideEvents OnBeforeRequest="WebGrid1_OnBeforeRequest" OnAfterResponseProcess="WebGrid1_OnAfterResponseProcess" /> </LayoutSettings> <RootTable> ... </RootTable> </ISWebGrid:WebGrid>
Script code:
<script language="javascript" type="text/javascript"> <!-- function WebGrid1_OnBeforeRequest(controlId, action) { var WebGrid1 = ISGetObject(controlId); var div1 = document.getElementById("div1"); if (action == "Refresh") div1.style.zIndex = 1; return true; } function WebGrid1_OnAfterResponseProcess(controlId, actionName, lastRequestObject, xmlResponseObject) { var WebGrid1 = ISGetObject(controlId); var div1 = document.getElementById("div1"); if (actionName == "Refresh") div1.style.zIndex = 0; return true; } --> </script>
Hope this helps. If anyone has better idea, please kindly share with us.
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