This is something that started happening when I upgraded from version 13.2.20132.2055 to 13.2.20132.2300. I had no issues on 20132.2055. Please let me know how I can fix this problem and retrieve the options.value property.
Thanks,
Paul
Hello Paul ,
Thank you for posting in our forum.
I’ve checked whether there’s such an internal property for the combo in versions 2055, however there doesn’t seem to be one in the options collection:
I’ve attached a sample for your reference that has a igCombo defined with a value and text key. The sample uses the trial scripts for versions 13.2.20132.2055.
When attempting to retrieve the combo’s value in the following manner: $("#combo").data("igCombo").options.value the result is always null.
If you’re aiming to get the value you can use the ‘value’ method: $("#combo").igCombo("value");
I’m not really in what manner you’re setting a key/value pair to the combo and how you’re persisting that relation.
If getting the value via the value method does not solve the issue for you, could you describe the scenario which you’re trying to implement so that I can suggest a different approach?
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://www.infragistics.com/support
Hi Maya,
Here is a JsFiddle with my exact problem: http://jsfiddle.net/ru5Rk/6/
The combo, Country, is a key value pair. The key is an integer, and the value is a string. When using a DataSourceUrl for this combo, if you edit a row, then the Country shows up blank and does not load properly. This is why I had to manually set the value like I had mentioned in my first post. If you change this to just a DataSource, then this is not a problem. I commented out a DataSource in my JsFiddle, that you can use to test this. You'll notice that when editing a row, the Country shows up as expected.
I need to use a DataSourceUrl for my grid. This is only a problem in dialog edit mode, the fact that you see the integers in the actual grid is not an issue for me.
You could get the related value from the row associated with dialog element: var row= ui.dialogElement.data('tr');
From the row you can get the row data id and get the cell value:
var row= ui.dialogElement.data('tr');
var cellValue=$("#grid").igGrid("getCellValue",$(row).attr("data-id"), "Country");
Which you can then set as the value of the combo whne it gets bound to your remote data source:
$(document).delegate(comboInput, "igcombodatabound", function (evt, ui) {
$(evt.target).igCombo('value', cellValue);
});
I’ve modified you sample and you can refer to it at: http://jsfiddle.net/ru5Rk/8/
Let me know if you have any questions.
Thanks, this worked solution worked nicely for me.