Results 1 to 4 of 4

Thread: Drag select of columns in grid

  1. #1
    Sencha Premium Member LarssaAndin's Avatar
    Join Date
    Feb 2012
    Posts
    76
    Answers
    3

    Default Answered: Drag select of columns in grid

    I would really like to be able to drag select grid columns (like you can do with cells if you use the correct selection model).

    Can someone give me an idea on how to add this feature to my grid? In cells there are mouse events to listen to but I can't figure out how to get that from the column headers.

  2. I don't see that this exists with the SpreadsheetModel as far as column header selection goes, but take a look at this example to see if it gets you started toward a solution. It's a little rough around the edges, but should help.


  3. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    I don't see that this exists with the SpreadsheetModel as far as column header selection goes, but take a look at this example to see if it gets you started toward a solution. It's a little rough around the edges, but should help.

    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  4. #3
    Sencha Premium Member LarssaAndin's Avatar
    Join Date
    Feb 2012
    Posts
    76
    Answers
    3

    Default

    Many thanks for this! I did have to rewrite it a bit, but that was because I'm including this feature inside my own version of the spreadsheet model and not by having it in the grid controller.

    One thing that I recommend anyone using this code is to place the mouseup listener on the body (or perhaps the grid) as you now risk loosing the mouse up event if you happen to be outside the header when releasing the mouse button.

    Another thing I will have to do some work with is that I have columns with subcolumns in my grids. The issue with this is that the sub column headers are located inside the box of the parent header. Not exactly difficult to solve, but still some work to make right.

  5. #4
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    If you don't mind sharing your finished solution, I'd be happy to see what you come up with. I can see this being a helpful feature.
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

Similar Threads

  1. Replies: 1
    Last Post: 28 Jan 2014, 4:37 PM
  2. Drag Grid Row Select
    By parky128 in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 15 Nov 2011, 2:53 PM
  3. checkbox in column header of grid to select multiple columns in grid
    By Komal Vaswani in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 21 Jun 2011, 9:08 PM
  4. Add Columns to grid via drag and drop
    By [email protected] in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 16 Nov 2008, 11:06 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
  •