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
Can someone show me how to retrieve a WebGrid's DropDownlist field? I am able to retrieve the WebGridCell by Name and then use the GetElement method to retrieve the DOM object but I don't seem to find the underlying DropDownList control?
If you are trying to retrieve the dropdown element during OnEnterEditMode you could use the element property of the editObject parameter. Here is the snippet:
function _WebGrid_OnEnterEditMode(controlId, tblName, editObject) { var dropDown = editObject.element; ...}
If not, by my analysis the dropdown element will be assigned an ID with [WebGridName]__[ColumnName], you could use document.getElementById method to retrieve the element. For example if you named your WebGrid WebGrid1 and the column is Company, the method will be:
document.getElementById("WebGrid1__Company")
Unfortunately, as far as I know the infromation is not available in WebGridCell object.
Hello,
You can use Glenn approach or retrieve the dropdown element by attaching onchange event.
e.g
function DropDownSelect() { var ddObject = document.getElementById("WebGrid1_Company"); var grid = ISGetObject("WebGrid1"); alert("Text: " + ddObject.options[ddObject.selectedIndex].innerText + "\nValue: " + ddObject.options[ddObject.selectedIndex].value); } function AttachEvent() { var dd = document.getElementById("WebGrid1_Company"); dd.attachEvent('onchange', DropDownSelect); } function WebGrid1_OnInitialize(controlId) { AttachEvent(); }
Note: If you have a trouble in finding dropdownlist id, you can try to use view source after load the page.
Regards,Handy
If you are trying to retrieve the dropdown element during OnEnterEditMode you could use the element property of the editObject parameter. Here is the snippet:function _WebGrid_OnEnterEditMode(controlId, tblName, editObject) { var dropDown = editObject.element; ...}If not, by my analysis the dropdown element will be assigned an ID with [WebGridName]__[ColumnName], you could use document.getElementById method to retrieve the element. For example if you named your WebGrid WebGrid1 and the column is Company, the method will be:document.getElementById("WebGrid1__Company")Unfortunately, as far as I know the infromation is not available in WebGridCell object.
Using document.getElementbyId or JQuery using the provided naming convention worked. It would be a nice feature request to include this in the object via property and/or method in the future.
Thanks!
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