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
Hello, i have 3 coloums in my webgrid:
STATUS NAME EMAIL
(Dropdownlist) (Webcombo) (Webcombo)
the status is: external or internal.
wenn i add a new row and the webcombo is not empty i want to set the status to internal.
when the webcombos are empty i want to set the status to external.
is that possible?
thanks in advance for your help
You can try to use the OnBeforeAdd client side event of WebGrid. It is the client side (JavaScript) function that will be invoked before new row request is invoked.
In this event, you can check whether column NAME or EMAIL is set or not. If they are set, call the SetText and SetValue method to STATUS column.
Example:
function WebGrid1_OnBeforeAdd(controlId, tblName, rowObject) { var WebGrid1 = ISGetObject("WebGrid1"); var NameCell = rowObject.Cells.GetNamedItem("Name"); var EmailCell = rowObject.Cells.GetNamedItem("Email"); var StatusCell = rowObject.Cells.GetNamedItem("StatusCell"); if (NameCell.Value != "" && EmailCell.Value != "") { StatusCell.SetText("Internal"); StatusCell.SetValue("1"); } else { StatusCell.SetText("External"); StatusCell.SetValue("2"); } return true; }
Hope this helps.
thank you but i must check if the value that i entered in the webcombo exists in the datasource.
when i enter a value it autocomplete it and the status is internal, but when i enter a value that is not in the datasource the status should change to external before adding.
In my opinion, we need to enable AllowAddItem property of WebCombo and assign a JS function for the OnAddItem client side event. This event fired when an item is about to be added.
You may try to set the text to external in this JS function before the return true line. Please feel free to let me know whether this helps or not.
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