jQWidgets Forums

jQuery UI Widgets Forums Grid How do I get the VALUE of a ComboBox editor inside jqxGrid?

This topic contains 2 replies, has 2 voices, and was last updated by  ericwastaken 12 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • ericwastaken
    Participant

    Hi,

    I am using jqWidgets 2.6.1.

    I have a grid that has a column editor set as jqxComboBox. It displays and works great and I can select values fine on any row. I have displayMember and valueMember both set for my ComboBox.

    However, on the ‘updaterow’ event or if I try ‘getrowdata’ on a specific row, the value I get for the ComboBox column shows the displayMember and not the valueMember.

    Can you clarify how to get the valueMember value from a row that uses a ComboBox editor for a particular cell?

    Thanks,

    Eric.


    Peter Stoev
    Keymaster

    Hi Eric,

    Please, take a look at this sample: gridkeyvaluecolumn.htm. It demonstrates how to define a column with values and labels.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    ericwastaken
    Participant

    Great! Your example helped me find my error.

    For the benefit of others, here were my errors.

    – On the data adapter, I was not defining the datafield correctly. I should have had the column as follows:

    { name: ‘AssignedToUserId’, displayname: ‘AssignedToUsername’ }

    (I was missing the “displayname”).

    – On the GRID, I also was missing the displayfield property. I should have had my column as follows:

    { text: ‘Assign to Patient’, datafield: ‘AssignedToUserId’, displayfield: ‘AssignedToUsername’, editable: true, columntype: ‘combobox’, width: 300,
    // Show a combobox editor
    initeditor: function (row, cellvalue, editor) {
    editor.jqxComboBox(
    {
    source: sfDropbox.dataadapterPatients,
    theme: sfDropbox.theme,
    selectedIndex: -1,
    displayMember: ‘PatientDetail’,
    valueMember: ‘UserID’
    });
    }
    }

    – o –

    Once I added the two “displayfield” properties, all worked as expected.

    Thanks!

    E

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

You must be logged in to reply to this topic.