Results 1 to 2 of 2

Thread: CellSelectionModel with reorder support - DND

  1. #1
    Sencha Premium User
    Join Date
    Sep 2009
    Posts
    311

    Default CellSelectionModel with reorder support - DND

    Code:
    package com.example.client.widget.grid;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import com.extjs.gxt.ui.client.data.ModelData;
    import com.extjs.gxt.ui.client.widget.grid.CellSelectionModel;
    
    public class XCellSelectionModel<M extends ModelData> extends CellSelectionModel<M> {
    
        @Override
        public M getSelectedItem() {
    
            M sel = null;
            final CellSelection selectedCell = getSelectCell();
    
            if (selectedCell != null) {
                sel = selectedCell.model;
            }
    
            return sel;
        }
    
        @Override
        public List<M> getSelectedItems() {
    
            final List<M> list = new ArrayList<M>();
    
            final M selectedItem = getSelectedItem();
            if (selectedItem != null) {
                list.add(selectedItem);
            }
    
            return new ArrayList<M>(list);
        }
    }

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    This was already implemented directly in GXT and will be part of GXT 2.2.1

Similar Threads

  1. Reorder rows with DND on a grouping grid
    By Nico33 in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 8 Apr 2010, 5:49 AM
  2. DnD DataView to DataView with reorder - ScrollManager problem
    By gumby in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 31 Mar 2010, 1:14 PM
  3. DnD Grid reordering does not reorder the binded list
    By Kilk in forum Ext GWT: Discussion
    Replies: 3
    Last Post: 1 Mar 2010, 2:53 AM
  4. Reorder/DnD items in a Ext.menu.Menu
    By Dr. Flink in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 16 Feb 2009, 12:35 AM
  5. Replies: 0
    Last Post: 17 Sep 2007, 12:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •