jQuery UI Widgets Forums General Discussions ListBox drag dosn't work after beginUpdate

This topic contains 3 replies, has 2 voices, and was last updated by  Hristo 1 month ago.

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

  • magostini
    Participant

    Hello,
    In my project I’ve a ListBox where several items are inserted dynamicly. But after inserted items between beginUndate and endUpdate the drag functionality dosn’t work! This happens also in yours api’s example
    http://jsfiddle.net/jqwidgets/0721wayw/
    Naturaly I’ve set allowDrag property to true!
    regards


    Hristo
    Participant

    Hello magostini,

    Please, try to use the render method on the end.
    I would like to suggest you look at this example:
    $("#jqxListBox").jqxListBox("render");
    Please let me know if you have any other questions.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com


    magostini
    Participant

    Thanks for your reply! Your solution works partly… that is if I’m setting every listbox’s items with ‘source’ it works, instead if I use ‘addItem’ the drag still works but no item was added!!
    This dosn’t works:

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

    // Create a jqxListBox
    $(“#jqxListBox”).jqxListBox({
    source: source,
    theme: ‘energyblue’,
    width: ‘200px’,
    height: ‘250px’,
    selectedIndex: 3,
    allowDrag:true

    });
    $(“#jqxButton”).jqxButton({
    theme:’energyblue’
    });
    $(‘#jqxButton’).on(‘click’, function () {
    $(“#jqxListBox”).jqxListBox(‘beginUpdate’);
    $(“#jqxListBox”).jqxListBox(‘addItem’, ‘jQuery 1’);
    $(“#jqxListBox”).jqxListBox(‘addItem’, ‘jQuery 2’);
    $(“#jqxListBox”).jqxListBox(‘addItem’, ‘jQuery 3’);
    $(“#jqxListBox”).jqxListBox(‘addItem’, ‘jQuery 4’);
    $(“#jqxListBox”).jqxListBox(‘addItem’, ‘jQuery 5’);
    $(“#jqxListBox”).jqxListBox(‘endUpdate’);
    $(“#jqxListBox”).jqxListBox(‘render’);
    });

    This works:
    var source = [
    “Affogato”,
    “Americano”,
    “Bicerin”,
    “Breve”,
    “Café Bombón”,
    “Café au lait”,
    “Caffé Corretto”,
    “Café Crema”,
    “Caffé Latte”];

    // Create a jqxListBox
    $(“#jqxListBox”).jqxListBox({
    source: source,
    theme: ‘energyblue’,
    width: ‘200px’,
    height: ‘250px’,
    selectedIndex: 3,
    allowDrag:true,

    });
    $(“#jqxButton”).jqxButton({
    theme:’energyblue’
    });
    $(‘#jqxButton’).on(‘click’, function () {
    source.push(‘jQuery 1’);
    source.push(‘jQuery 2’);
    source.push(‘jQuery 3’);
    source.push(‘jQuery 4’);
    source.push(‘jQuery 5’);

    $(“#jqxListBox”).jqxListBox(‘beginUpdate’);
    $(“#jqxListBox”).jqxListBox(‘source’, source);
    $(“#jqxListBox”).jqxListBox(‘endUpdate’);
    $(“#jqxListBox”).jqxListBox(‘render’);

    });

    Thanks


    Hristo
    Participant

    Hello magostini,

    Thank you for your patience and for the examples.
    I will create a work item for this case.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

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

You must be logged in to reply to this topic.