1. #1
    Sencha User
    Join Date
    Sep 2013
    Posts
    2
    Vote Rating
    0
    haixiliu is on a distinguished road

      0  

    Default Answered: Can I have A grid column with checkbox + checkall header + hiddable

    Answered: Can I have A grid column with checkbox + checkall header + hiddable


    Hello All,

    I have been searching online but could not find a good solution for my need. Before I draw the conclusion, I would like to get some confirmation or suggestion from this forum.

    I need to have a column in a grid that:
    1. Has a checkall checkbox in header that allows user to select or deselect all rows in the grid.
    2. Can be hidden/removed based on certain condition when page is rendered (user permission or data)

    SelModel will satisfy requirement No. 1, but cannot be manipulated once defined (see http://www.sencha.com/forum/showthre...selectionModel).

    CheckColumn satisfies requirement No. 2, but doesn't have a checkall box in column header.

    Is there a way for me to achieve what I wanted?

    Thanks in advance

    Haixi

  2. You can always access CheckboxModel's header as gridPanel.headerCt.getAt(0). And then .setVisible().

  3. #2
    Sencha User
    Join Date
    Sep 2011
    Posts
    573
    Vote Rating
    74
    Answers
    58
    ettavolt is just really nice ettavolt is just really nice ettavolt is just really nice ettavolt is just really nice

      0  

    Default


    You can always access CheckboxModel's header as gridPanel.headerCt.getAt(0). And then .setVisible().

  4. #3
    Sencha User
    Join Date
    Sep 2013
    Posts
    2
    Vote Rating
    0
    haixiliu is on a distinguished road

      0  

    Default


    Thanks. gridPanel.headerCt.gridDataColumns[index].setVisible(boolean) worked for me!

    One more question on this when I am at it, is there a way to make sure the checkbox stays at the center of its column? I did not see any styling in all the examples I saw, and it seems the checkbox moves with the resizing of the grid/window.

    Thanks,
    Haixi

Thread Participants: 1

Tags for this Thread