Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-445

Drag and drop does not work for full listbox

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Normal Normal
    • 5.0.9
    • 5.0.8
    • General, ZHTML
    • IE8

    • None

      It is not possible to drag and drop items between two full listboxes. Seems to be a bug.
      It also happens intermittently between one full listbox and one partially filled listbox.

      I have tested this code in ZK Sandbox, so it is reproducible.

      <window title="Listbox" border="normal">
      <hbox>
      <listbox onDrop="move(event.dragged)" droppable="true" fixedLayout="true" rows="3">
      <listitem label="1" draggable="true" droppable="true"/>
      <listitem label="2" draggable="true" droppable="true"/>
      <listitem label="3" draggable="true" droppable="true"/>
      <listitem label="4" draggable="true" droppable="true"/>
      </listbox>
      <listbox onDrop="move(event.dragged)" droppable="true" fixedLayout="true" rows="3">
      <listitem label="5" draggable="true" droppable="true"/>
      <listitem label="6" draggable="true" droppable="true"/>
      <listitem label="7" draggable="true" droppable="true"/>
      <listitem label="8" draggable="true" droppable="true"/>
      </listbox>
      </hbox>
      <zscript>
      void move(Component dragged) {
      if (self instanceof Listitem)

      { self.parent.insertBefore(dragged, self); } else { self.appendChild(dragged); }
      }
      </zscript>
      </window>


      If the number of rows is changed to more than 4 then drag and drop works again.

      <window title="Listbox" border="normal">
      <hbox>
      <listbox onDrop="move(event.dragged)" droppable="true" fixedLayout="true" rows="6">
      <listitem label="1" draggable="true" droppable="true"/>
      <listitem label="2" draggable="true" droppable="true"/>
      <listitem label="3" draggable="true" droppable="true"/>
      <listitem label="4" draggable="true" droppable="true"/>

      </listbox>
      <listbox onDrop="move(event.dragged)" droppable="true" fixedLayout="true" rows="6">
      <listitem label="5" draggable="true" droppable="true"/>
      <listitem label="6" draggable="true" droppable="true"/>
      <listitem label="7" draggable="true" droppable="true"/>
      <listitem label="8" draggable="true" droppable="true"/>

      </listbox>
      </hbox>
      <zscript>
      void move(Component dragged) {
      if (self instanceof Listitem) { self.parent.insertBefore(dragged, self); }

      else

      { self.appendChild(dragged); }


      }
      </zscript>
      </window>

            benbai benbai
            sydd sydd
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m