jQuery UI Widgets Forums Grid Editable JqxGrid 2 combobox with same adapter

This topic contains 1 reply, has 1 voice, and was last updated by  Franco01 7 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Editable JqxGrid 2 combobox with same adapter #87727

    Franco01
    Participant

    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?


    Franco01
    Participant

    My mistake.
    I use the same displayfield: “WorkName” tag, I delete it, and It works fine!:)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.