jQWidgets Forums

jQuery UI Widgets Forums Grid jqxCombobox in jqxGrid with filter functionality but NOT autoComplete

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 11 years, 7 months ago.

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

  • Abijeet
    Participant

    Please refer to this link – http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/customizededitors.htm?arctic

    Here, we have a jqxComboBox in the first column with a three predefined items –

    ‘Stuttgart’, ‘Rio de Janeiro’, ‘Strasbourg’

    This combobox as I believe allows me to add custom elements. I want to add an item name Stu, but it’s impossible to do that, because whenever I type Stu and exit, ‘Stuttgart’ gets selected by default. I don’t want that. I want jqxComboBox to search and filter the items but not select them for me.

    Is that possible at all? This is kind of a little urgent.

    Regards.


    Dimitar
    Participant

    Hello Abijeet,

    To achieve what you require, please use the geteditorvalue callback function. Here is a modification of the column settings of the aforementioned example:

    {
    text: 'Ship City', datafield: 'ShipCity', width: 150, columntype: 'combobox',
    createeditor: function (row, column, editor) {
    // assign a new data source to the combobox.
    var list = ['Stuttgart', 'Rio de Janeiro', 'Strasbourg'];
    editor.jqxComboBox({ autoDropDownHeight: true, source: list, promptText: "Please Choose:" });
    },
    // update the editor's value before saving it.
    cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) {
    // return the old value, if the new value is empty.
    if (newvalue == "") return oldvalue;
    },
    geteditorvalue: function (row, cellvalue, editor) {
    // return the editor's value.
    return editor.find('input').val();
    }
    },

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.