I have an editable JqxGrid with 2 columns. WorkName1 and WorkName2. I would like to use Combobox for it.
columns: [ {
text: "WorkName1", displayfield: "WorkName1", datafield: "WorkName1", width: 120, cellsalign: "right", columntype: 'combobox',
createeditor: function (row, value, editor) {
editor.jqxComboBox({ source: dataAdapter, selectedIndex: 0, displayMember: "WorkName", valueMember: "WorkID" });
},
{
text: "WorkName2", displayfield: "WorkName2", datafield: "WorkName2", width: 120, cellsalign: "right", columntype: 'combobox',
createeditor: function (row, value, editor) {
editor.jqxComboBox({ source: dataAdapter, selectedIndex: 0, displayMember: "WorkName", valueMember: "WorkID" });
}]
Here is my dataAdapter:
var source =
{
datatype: "json",
datafields: [{name: 'WorkName'},{name: 'WorkID'}],
url: "./Work/GetWork",
async: false
};
var dataAdapter = new $.jqx.dataAdapter(source);
When I set Work1 value after cellvaluechanged event Work2 value = Work1 value, and vica versa.
What’s the problem? Should I use different dataAdapter?
What If I have dynamic columns Work1, Work2 …Workn?