jQWidgets Forums

jQuery UI Widgets Forums Lists ListBox get new listbox order?

This topic contains 3 replies, has 2 voices, and was last updated by  edwardsmarkf 8 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • get new listbox order? #89801

    edwardsmarkf
    Participant

    hello – what is the best way to get the NEW order of a listbox after a user has reordered the listbox?

    in other words, is there a way to convert the data contained in listbox back to an array or object after reordering?

    this does not seem to change:

    $(“#listBoxA”).jqxListBox(‘source’)

    thank you very much.

    get new listbox order? #89837

    ivailo
    Participant

    Hi edwardsmarkf,

    If you want to get the items of the widget, you can use getItems method.
    Please, refer to the following example : http://jsfiddle.net/jqwidgets/SDJqH/

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    get new listbox order? #89843

    edwardsmarkf
    Participant

    something like this is interesting, assuming there is absolutely no scrolling involved:

    $("[id^=listitem]").each(function(index) { console.log( index + ": " + this.id + '<--->' + $(this).text() ); });

    it appears the div id contains an order number, but all the items that are currently NOT displaying do not show.

    get new listbox order? #89845

    edwardsmarkf
    Participant

    scratch question please “getItem” method is what i needed.

    for ( var x=0; x < $('#listBoxA').jqxListBox('getItems').length ; x++ )  {
         console.log (x + ' -->> ' + $('#listBoxA').jqxListBox('getItem', x).value ) ;  
    }
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.