Hello,
I'm currently working with igGrid and having difficult figuring out how to do something.
I have a cell in my grid setup as a comboBox called "JobID". I also have another column in my grid called "JobKey".
The valueKey of the JobID combo is JobKey. If the user is entering a new row of editing a row, I want the JobKey column to update to display the correct one.
So how do I set the JobKey cell in this row the same as the valueKey of my in-Grid combo's valueKey?
This i've been tinkering around with selectionChange, but never got it working. This was my closest attempt.
{
columnKey: 'JobID',editorType: 'combo',editorOptions:
{ loadOnDemandSettings: { enabled: true, pageSize: 25 }, responseDataKey: "value", dataSource: jobDS, filteringType: "remote", textKey: "JobID", valueKey: "JobKey", virtualization: true, autoComplete: true, itemTemplate: "<div>${JobID} - ${JobName}</div>", nullText: "", headerTemplate: "<div class='dropDownHeaderFooter'>Select a Job</div>", footerTemplate: "<div class='dropDownHeaderFooter'></div>", filterExprUrlKey: 'startsWith', mode: 'editable', selectionChanged: function (evt, ui) { $("#gridReservations").igGridUpdating("setCellValue", //getrowID?, 'JobKey', //valueKey??); }
}
};
(sorry for poor indentation)
Thanks,
Julie
Hello Julie,
Thank you for contacting Infragistics Support!
It's not clear enough what you are trying to achieve. Please review the attached sample and let me know if this is the desired behavior.
If not can you please modify the sample, so that it reproduces the issue. Looking forward to your answer!
Sorry about the misunderstanding. The code does not work, but I've edited it closer to what I'm trying to achieve and took some screen shots to help explain.
So I added a column called NameKey and changes Name to be a drop down with textKey: "Name" and valueKey: "NameKey".
So in screenshot s1 I provided, the user selects "Pink Lemonade" in the Name column, which then the NameKey column is automatically updated to the corresponding NameKey for "Pink Lemonade". Something like setting the cell to $(".selector").igCombo("option", "valueKey"); but using a combo that is in the grid (the Name column).
$(
".selector"
).igCombo(
"option"
,
"valueKey"
);
I provided a second screen shot s2, where the user chooses "Vint Soda" and The NameKey column is changed to "157" ...VintSoda's value key.
I hope this helps clear up what I mean.