jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox clear selection of combo box

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Stoev 10 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • clear selection of combo box #59543

    selva
    Participant

    Hi,

    I have a list of elements, user has to select only one among them.
    but i used jqxcombobox, instead of jqxdropdownlist, because of its autocomplete facility.
    but with jqxcombobox, user will have facility not only to select one from the list but also to write something which does not match with any of the elements in the list. To avoid for this condition i add one attribute in jqxcombobox which is selectionMode:’dropDownList’.

    var source = [
          "Affogato",
          "Americano",
          "Bicerin",
          "Breve",
          "Café Bombón",
          "Café au lait",
          "Caffé Corretto",
          "Café Crema",
          "Caffé Latte"];
    
      // Create a jqxComboBox
      $("#jqxComboBox").jqxComboBox({
          source: source,
          theme: 'energyblue',
          width: '200px',
          height: '25px',
          selectionMode: 'dropDownList'
      });

    if user write anything does not match any of the options in list, its automatically fetch the index 0th element. or just enter into combobox and leaves without typing(selecting) anything its also fetch the index 0th element.To avoid this functionality i add ‘Select’ option in
    index 0.So user just enter and leave the combobox Select is displayed.

    My Question is suppose i select the 3rd index of element and clear the selected element using clearSelection method. after that i enter and leave without select or type anything it fetch previous selected value(3rd index of element) instead of 0th index of element. How to make fetch 0th index of element.

    clear selection of combo box #59544

    selva
    Participant

    Here is the working example of jsfiddle:

    http://jsfiddle.net/smpskumar/3RJEU/46/

    clear selection of combo box #59545

    Peter Stoev
    Keymaster

    Hi selva,

    You can use the “selectIndex” method passing 0 as argument for selecting the first element.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.