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
I control columns' visible and refresh the webgrid,but when i edit data on webgrid,the data will lost
i just used the Javascript,the following:
<script language="javascript" type="text/javascript">
<!--
function button1_onclick() {
var WebGrid1 = ISGetObject("WebGrid1");
var rootTable = WebGrid1.GetRootTable();
var PhoneColumn = rootTable.Columns.GetNamedItem("Phone");
PhoneColumn.Set("Visible", "false", true);
WebGrid1.RefreshAll();
return true;
}
// -->
</script>
Please forgive me for lack of understanding about the reported problem.
I made a simple page based on your description of the problematic behavior. The page is enclosed as attachment within this reply. The page has a WebGrid and an HTML button. The grid is bind to Shippers table of Northwind database and enabled for the following property/feature: AllowAddNew; AllowDelete; AllowEdit; and AllowBatchUpdate.
The HTML button is used to set the column visibility at client-side by using the same snippet code as mentioned in your original post.
Below is the step-by-step that I made when I try to reproduce the issue.
View the page in browser.
Edit data, for example: modify “Speedy Express” to “DHL”.
Move the focus to the next row or simply press “Shift + Enter”.
Press the “Hide Phone Column” HTML button.
Edited data is lost and “Phone” column is disappearing.
Please let me know whether the step-by-step is correct or not. If the step-by-step is correct, the edited data is lost because of the “RefreshAll()” method that is invoked after “PhoneColumn.Set(“Visible”, “false”, true) line.
The RefreshAll() method will refresh the whole data, including the grid structure.
Hope this helps.
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