Results 1 to 3 of 3

Thread: move columns in a lock enabled grid

  1. #1
    Sencha User vick_44's Avatar
    Join Date
    Jul 2016
    Posts
    64
    Answers
    6

    Default Answered: move columns in a lock enabled grid

    I have a grid which needs to have few locked columns on a toggle button press and get them unlocked when I press the button again. Right now I have this functionality working but the problem is when I press the button the second time, the unlocked columns stays at the new position , that is on the left side of the grid. I need to move them back to their original index. Is it possible to move the columns in a grid once i unlock all columns?

    The problem I am facing is once i unlock all the grid columns, when I try to move the column nothing happens. I figure its due to the property 'enableLocking: true' in the grid. Below is a simple fiddle which shows moving columns, right now I have commented enableLocking: true at line 39. As soon as you uncomment (#39) it, the move column stops working.

    https://fiddle.sencha.com/#fiddle/2h93&view/editor

    Is there any way to achieve this functionality, to move columns by their index in a grid where enableLocking is true?.
    Any help or pointers is deeply appreciated!!!.

  2. Maybe this helps:

    Code:
    handler: function (btn) {
        var grid = btn.up('gridpanel'),
            headerCt = grid.normalGrid.headerCt;
                            
            headerCt.move(0,1);
                        
            grid.getView().refresh();
    }

  3. #2
    Sencha Premium User twaindev's Avatar
    Join Date
    Sep 2009
    Posts
    242
    Answers
    16

    Default

    Maybe this helps:

    Code:
    handler: function (btn) {
        var grid = btn.up('gridpanel'),
            headerCt = grid.normalGrid.headerCt;
                            
            headerCt.move(0,1);
                        
            grid.getView().refresh();
    }

  4. #3
    Sencha User vick_44's Avatar
    Join Date
    Jul 2016
    Posts
    64
    Answers
    6

    Default

    Thanks : ). This works like a charm!!!

Similar Threads

  1. Replies: 4
    Last Post: 29 May 2012, 9:18 PM
  2. Replies: 0
    Last Post: 19 Apr 2012, 1:55 AM
  3. How to move a grid's columns?
    By mcadirci in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 5 Feb 2011, 7:24 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
  •