jQuery UI Widgets Forums Lists ListBox listbox select Item problem

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  ivailo 9 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • listbox select Item problem #71199

    mustafa
    Participant

    hello
    I’m trying, but this example does not work

    I can not only use string

       var source = [
           "Affogato",
           "Americano",
           "Bicerin",
           "Breve",
           "Café Bombón",
           "Café au lait",
           "Caffé Corretto",
           "Café Crema",
     "Caffé Latte"];

    I had to use ID

    http://jsfiddle.net/jqwidgets/8MaPZ/

    and I can use select ID? because may be same name 2 record
    thank you

     var vesselRelatedWorkPositions = [];
    
            vesselRelatedWorkPositions.push({ ID:  1, Name: "ITEM1"});
            vesselRelatedWorkPositions.push({ ID:  2, Name: "ITEM2"});
            vesselRelatedWorkPositions.push({ ID:  3, Name: "ITEM3"});
            vesselRelatedWorkPositions.push({ ID:  4, Name: "ITEM4"});
            vesselRelatedWorkPositions.push({ ID:  5, Name: "ITEM5"});
    
       // Create a jqxListBox
       $("#jqxListBox").jqxListBox({
           source: vesselRelatedWorkPositions,
           theme: 'energyblue',
           width: '200px',
           height: '250px',
           displayMember: "Name",
           valueMember: "ID"
       });
       $("#jqxButton").jqxButton({
           theme: 'energyblue'
       });
       $('#jqxButton').on('click', function () {
          $("#jqxListBox").jqxListBox('selectItem','ITEM5');
      });
    • This topic was modified 9 years, 1 month ago by  mustafa.
    • This topic was modified 9 years, 1 month ago by  mustafa.
    • This topic was modified 9 years, 1 month ago by  mustafa.
    listbox select Item problem #71227

    ivailo
    Participant

    Hi mustafa,

    You can select an item via valueMember.
    Here is the fiddle.

    Best Regards,
    Ivailo Ivanov

    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.