jQWidgets Forums

jQuery UI Widgets Forums Lists ListBox Drag and drop: originalItem==null

Tagged: 

This topic contains 4 replies, has 3 voices, and was last updated by  reblutus 11 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Drag and drop: originalItem==null #17703

    carlo
    Participant

    Hello Peter,

    if we drag an item from listbox A to listbox B, then the new item in listbox B the property originalItem is null. How do we get the orginal item ?

    Best Regards,
    Carlo

    Drag and drop: originalItem==null #17705

    Peter Stoev
    Keymaster

    Hi Carlo,

    There is no such property in the API documentation.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Drag and drop: originalItem==null #17713

    carlo
    Participant

    Hi Peter,

    our listbox source is an array of objects like { id: 1, name ‘Otto}. When we call

    var item = $(“#listBoxA”).jqxListBox( “getSelectedItem” );

    then item has the property originalItem, which is the selected array object.

    Best Regards,
    Carlo

    Drag and drop: originalItem==null #17855

    Peter Stoev
    Keymaster

    Hi Carlo,

    Thanks for the feedback.

    We will investigate the reported behavior.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Drag and drop: originalItem==null #28465

    reblutus
    Blocked

    I also have this problem. when I drag an item from listBoxA (which each items have an originalItem value) and drop it to the listBoxB the copy of the item leaves the originalItem to null.

    When the dropAction “copy” is executed it is imperative that the originalItem value is preserved!

    	var messages = [];	
    messages.push({id:1, name:"Ouverture", time:"09:12"});
    messages.push({id:2, name:"fermeture", time:"10:15"});
    messages.push({id:3, name:"publicité 001", time:"12:30"});
    messages.push({id:4, name:"pub 002", time:"15:05"});
    var messagesSource = {
    localdata: messages,
    datatype: "json",
    datafields: messageListDataFormat,
    id: 'id'
    };
    var messagesDataAdapter = new $.jqx.dataAdapter(messagesSource);
    $("#listBoxA").jqxListBox({ source: messagesDataAdapter, displayMember: "name", valueMember: "id", dropAction:'copy', allowDrop: false, allowDrag: true, width: 240, height: 425, theme: "s360",
    dragStart: function (item) {
    $("#listBoxB").jqxListBox({dropAction:'copy'});
    }
    });
    $("#listBoxB").jqxListBox({ source: eventMessagesDataAdapter, displayMember: "name", valueMember: "id", dropAction:'copy', allowDrop: true, allowDrag: true, width: 240, height: 425, theme:"s360"});
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.