1. #1
    Sencha Premium Member
    Join Date
    Sep 2010
    Posts
    10
    Vote Rating
    0
    vukbyte is on a distinguished road

      0  

    Default Disable toggling groups in a GroupingView

    Disable toggling groups in a GroupingView


    I am using a GroupingView in a grid, is there a way to prevent the user from toggling any or all of the groups? At certain times I don't want the user to be able to toggle any of the groups.

    The reason for this is because I am using the RowEditor plugin, and when the user is in edit mode and they choose to collapse the group which belongs to the row they are editing the RowEditor is still visible, but it is on top of a different row.

    Ideally I would like to prevent the user from toggling any groups in that case, or if there is an event that I can listen to, I could also cancel the current row that is being edited so there isn't a row editor just floating around.

    Any suggestions??

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    There is no config option for this, but you could disable the toggleGroup method, e.g.

    Code:
    grid.getView().toggleGroup = Ext.emptyFn;
    ...
    grid.getView().toggleGroup = Ext.grid.GroupingView.prototype.toggleGroup;

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2010
    Posts
    10
    Vote Rating
    0
    vukbyte is on a distinguished road

      0  

    Default


    It worked perfectly. Thank you very much.

    I added listeners to the beforeedit and afteredit events for the RowEditor to disable and enable the toggle of groups.

    Code:
      var beforeEdit = function(rowEditor) {
        rowEditor.grid.getView().toggleGroup = Ext.emptyFn;
      };
    
      var afterEdit = function(rowEditor) {
        rowEditor.grid.getView().toggleGroup = Ext.grid.GroupingView.prototype.toggleGroup;
      };

  4. #4
    Sencha User
    Join Date
    Feb 2011
    Posts
    53
    Vote Rating
    0
    maslofer is on a distinguished road

      0  

    Default


    This doesn't work in ExtJS 4.

    Is there anyway to disable the toggling in Ext JS 4?

Similar Threads

  1. Can you Sort Groups in a Grid with a GroupingView
    By brookd in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 11 Oct 2011, 11:22 AM
  2. how to expand groups in GroupingView
    By llsand in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 2 Oct 2009, 4:12 AM
  3. Auto collapse groups in GroupingView
    By emerout in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 10 Jun 2009, 7:10 AM
  4. Gridpanel and GroupingView with empty groups
    By elvelind in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 9 Jun 2009, 4:42 AM
  5. Collapse just some (not all) groups inside a GroupingView
    By Joschy in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 11 Jan 2009, 11:42 AM

Thread Participants: 2

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar