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 need to validate particular column in webgrid.
Suppose, I have multiple columns in webgrid and I want whenever I edit the particular row and particular column then validation should be happen for that particular column cell, not on other cell of that row.
After validation(suppose value is greatter than >10) do not able to change the value and give a laert message and udo the changes value(old value) in particular cell.
Note: Pending changes should not increase, as we did undo changes on that paricular cell.
I have added javascript code on webgrid1_OnAfterExitEditMode as follows:
RowObject.GetCells().GetNamedItem("ss").SetText(RowObject.GetCells().GetNamedItem("ss").Get("OldText"), true);
RowObject.GetCells().GetNamedItem("ss").SetValue(RowObject.GetCells().GetNamedItem("ss").Get("OldValue"), true);
Attached the picture for references.
Please reply ASAP.
Regards
Sachin Jain
How to undo change the cell/row values after validation fails?
The above question taken from screenshot 2.png (attached) in Sachin Jain initial post.
You can invoke UndoChanges() method on WebGridRow object such as shown in the following snippet code.
function ValidateRowCell() { var grid = ISGetObject("WebGrid1"); grid.RootTable.GetRow(0).UndoChanges(); }
Hope this helps.
your code snippet is not working for me.
Here is my code which i added:
function WebGrid1_OnAfterExitEditMode(controlId, tableName, editObject) {
var grid = ISGetObject(controlId);
var RowObject = grid.GetSelectedObject().ToRowObject();
var ItemId = RowObject.GetCells().GetNamedItem("ItemId");
if (CheckValue(ItemId.Value)) {//Here Checkvalue is function, to validate the Item Value
RowObject.UndoChanges();
}
RowObject.UndoChanges(); is not working.
Try to invoke ClearSelectedObject() method after calling UndoChanges(), so your code will look like following:
function WebGrid1_OnAfterExitEditMode(controlId, tableName, editObject) { var grid = ISGetObject(controlId); var RowObject = grid.GetSelectedObject().ToRowObject(); var ItemId = RowObject.GetCells().GetNamedItem("ItemId"); if (CheckValue(ItemId.Value)) { //Here Checkvalue is function, to validate the Item Value RowObject.UndoChanges(); grid.ClearSelectedObject(); } }
This should 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