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 have a WebGrid and I'm using a dropdown for a column (location). The column is part of a record representing a phone in an office (location, phone number extension).
The source of the dropdown is a stored procedure.
There are multiple ways of editing here, but one of the options is when the clicks a button, a 'search' window appears allowing the user to select a different office phone. When this is done, I get the location code of the new phone.
I can get the location code (which is the ListDataValueField for the dropdown) but how can I get the ListDataText field value?
In other words, I only have the Value for the cell. How can I get the Text value from the dropdown when given the Value of the cell?
OK, I may have found somthing which works for me.
I have found that the values held for the drop down list are stored somewhere in the current page in a <select where the id for the object is <gridname>_<tablename>_<columnname>. I can then acess this in jQuery and get the text value with the following.
// assume that the select object on the webpage is named grid1_table1_mycolumn
// assume that the value of the cell is held in the cellValue variable.
var dropdownTextValue = $("#grid1_table1_mycolumn option[value='" + cellValue + "']").text();
function UpdateGrid(){ var wgTest = ISGetObject("wgTest"); var row = wgTest.RootTable.GetRow(2); var cells = row.GetCells(); var interestCell = cells.GetNamedItem('Interest'); interestCell.SetValue("1"); row.Select(); interestCell.ActivateEdit(); row.SetDataChanged(); row.Update(); wgTest.MarkEdit();}function wgTest_OnEnterEditMode(controlId, tblName, editObject){ var wgTest = ISGetObject(controlId); var selIndex = editObject.element.selectedIndex var selText = editObject.element.options[selIndex].text; editObject.ToCellObject().SetText(selText);}
This doesn't work for me. Let's assume that I do not want to use the OnEnterEditMode because people can enter the edit mode if they want so it would be called in multiple instances.
Let's say in javascript I have the value for the dropdown. I obviously know the grid and column I'm working with.
How can I get to the list of values/text values for the dropdown?
I've tried grid.RootTable.Columns.GetNamedItem("site").ValueList but there is no data to be pulled. It's DataRetrieved attribute is false.
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