Results 1 to 6 of 6

Thread: Allowing CellSelectionModel to select multiple cells

  1. #1

    Default Allowing CellSelectionModel to select multiple cells

    In an attempt to create an "Excel" like functionality with the Grid, I have changed the default Grid Selection Model to be the CellSelectionModel, since that allows for individual cell selection. However, the SelectionMode.MULTI is not supported as far as I can tell with the CellSelectionModel, is that correct?

    If so, what would be the approach to support a CellSelectionModel with SelectionMode.MULTI?

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

    Default

    Yes that is correct. It is not supported. CellSelectionModel only supported selecting of a single cell. At the moment, if selectCell is called, all old selection is cleared. You will need to extend CellSelectionModel and override how it is working at the moment.

  3. #3

    Default Allowing CellSelectionModel to select multiple cells.

    Ok, took your advice and built the MultiCellSelectionModel class that extends CellSelectionModel and supports the selection of multiple cells using the SHIFT or CTRL keys + arrow keys or mouse.

    Have not fully tested the class, but seems to be working correctly so far. For those of you interested in using this in your application simply :

    grid.setSelectionModel(new MultiCellSelectionModel<ModelData>());

    source code is attached.
    Attached Files Attached Files

  4. #4

    Default

    Sorry, forgot to mention, in order to get a list of selected cells, simply call MultiCellSelectionModel.getSelections(). If the resulting list is empty, it means multiple cells where not selected.

  5. #5

    Default Errror:onCellSelect(row, cell);

    Hi i am trying to use ur class in my application ...but it shows error while calling the onCellSelect(row, cell) and onCellDeSelect(row, cell) ....Its a protected method in GridView class ...how can we use this method ...
    I need the multiselection and copy paste functionlity in grid ...

    Thanks in advance if it will be a sample code:




    Deepak S

  6. #6
    Sencha User
    Join Date
    Oct 2009
    Location
    Ho Chi Minh, Viet Nam
    Posts
    5

    Default

    Please visit here: http://www.sencha.com/forum/showthre...190#post821190 for discuss more.

Similar Threads

  1. Multiple Cells Selection Model
    By kpopov in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 28 Feb 2014, 1:45 AM
  2. Replies: 1
    Last Post: 27 Oct 2009, 8:08 AM
  3. select cells like we do in Excel
    By sseetharaman in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 4 Mar 2009, 4:30 AM
  4. Set style of grid row cells during a select
    By rlaferla in forum Sencha GXT Q&A
    Replies: 0
    Last Post: 24 Feb 2009, 8:12 PM
  5. Possible to rectangular select marquee for multiple select?
    By ryes540 in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 15 Mar 2007, 12:18 PM

Tags for this Thread

Posting Permissions

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