jQuery UI Widgets Forums Lists ListBox getSelectedItem and returning null

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 2 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • getSelectedItem and returning null #104698


    I am seemingly having a problem with the following scenario:

    I add an item (i.e. append) to a list, which already has 3 items.
    I now have 4 items.
    I then delete the last item from the list.
    If I then test for an item in the 4th position, using getSelectedItem, I do not get a null return, as the documentation claims.

    Instead if I use:

    var item = jQuery(selector).jqxListBox(‘getSelectedItem’);
    console.log (item.toSource());

    The display shows ‘(function (){return h})’.
    I expected a null return.

    So if I use jQuery.isEmptyObject(item) to test for an empty item, it indicates ‘not empty’.

    Am I missing something?

    Any suggestions on the way forward will be appreciated!


    getSelectedItem and returning null #104737


    Hello Alastair,

    I tested this example and it seems to work fine – it returns undefined.
    Could you clarify it?

    Best Regards,
    Hristo Hristov

    jQWidgets team

    • This reply was modified 2 years, 5 months ago by  Hristo.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.