1. #1
    Sencha User
    Join Date
    Aug 2013
    Posts
    33
    Vote Rating
    0
    asahoo is on a distinguished road

      0  

    Default Unanswered: Row Expander Plugin Extension

    I am using row Expander Plugin to Expand/Collapse Rows .

    I am also able to Expand All/Collapse all the rows by using some buttons (which are not part of Grid).

    Is it possible to add a +/- Icon in the grid Header as a column (above the Exapnder Column) for this purpose ?

    So lets say the Default icon is +, once user Clicks it it sshould toggle to _ and Viceversa.


    The grid Should look like this

    Name| + |Address |Age
    -------------------------------
    ABC| + | XYZ | 60
    CDE | + |GHI |40

    Any help on this is higly appreciated .

  2. #2
    Sencha User
    Join Date
    Sep 2014
    Location
    New Jersey
    Posts
    18
    Vote Rating
    1
    jmin91 is on a distinguished road

      0  

    Default

    I've never done this but it looks like there's icon and iconCls configs for the header. You can define a CSS class and add it to the iconCls. Assign a click event to it and add code to expand the row. Or if in the grid header you mean to toggle all rows, set that click event to loop through the rows and expand the rows.

  3. #3
    Sencha User
    Join Date
    Aug 2013
    Posts
    33
    Vote Rating
    0
    asahoo is on a distinguished road

      0  

    Default

    Yes That was my approach if , the +/- Column is a part of Original Grid's Column Configuaration . The Expander Column is getting Created by using Row Expnader Plug In .

    more Specifically in the addExpander() method of Row Expander plugin .

    plugins: [{
    ptype: 'rowexpander',
    expandOnEnter: true,
    expandOnDblClick: false,
    selectRowOnExpand: true,
    rowBodyTpl: [],
    addExpander: function() {
    var me = this,
    expanderGrid = me.grid,
    expanderHeader = me.getHeaderConfig();


    // If this is the normal side of a lockable grid, find the other side.
    if (expanderGrid.ownerLockable) {
    expanderGrid = expanderGrid.ownerLockable.lockedGrid;
    expanderGrid.width += expanderHeader.width;
    }
    expanderGrid.headerCt.insert(1, expanderHeader);
    expanderGrid.columns[1].setWidth(80);


    },


    So I belive the HeaderConfig is responsible for the creation of Columns (with + as cell value ). I am intrested to place teh Icons in this column Header.

  4. #4
    Sencha User
    Join Date
    Sep 2014
    Location
    New Jersey
    Posts
    18
    Vote Rating
    1
    jmin91 is on a distinguished road

      0  

    Default

    I don't think getHeaderConfig() is the right method. The API docs say that's used for a CheckboxModel - something completely different. Try this:

    Code:
    expanderHeader = me.getHeader();

Similar Threads

  1. Row Expander Plugin
    By hmp6121990 in forum Sencha Architect User Extensions/Templates
    Replies: 4
    Last Post: 18 Jul 2014, 10:19 AM
  2. Row Expander Plugin
    By hmp6121990 in forum Sencha Architect 3.x: Q&A
    Replies: 0
    Last Post: 16 Jul 2014, 11:02 AM
  3. Row Expander Plugin
    By hmp6121990 in forum Ext:User Extensions and Plugins
    Replies: 0
    Last Post: 16 Jul 2014, 11:02 AM
  4. Replies: 3
    Last Post: 31 Oct 2013, 2:23 PM
  5. Problem with Row Expander Plugin
    By Yemi in forum Ext 3.x: User Extensions and Plugins
    Replies: 2
    Last Post: 6 Aug 2013, 12:57 AM

Thread Participants: 1