1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    11
    Vote Rating
    0
    pbban is on a distinguished road

      0  

    Default Row Expander - Onclick of the row

    Row Expander - Onclick of the row


    Hi,

    I have implemented Ext.grid.RowExpander for a grid. However the row expands only when the (+) is clicked. However my requirement is that i need to expand the row when user clicks on the row. Also i don't want the (+) to appear.

    I am new to Extjs, would you be able to help!

    Thanks
    pbban

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    It already does that on 'rowdblclick'. You can modify the RowExpander.onRender method so it also does that on 'rowclick'.

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    11
    Vote Rating
    0
    pbban is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    It already does that on 'rowdblclick'. You can modify the RowExpander.onRender method so it also does that on 'rowclick'.
    Hi Condor,
    Thanks a lot for your reply.

    When i dbl-click the row of my grid, it does not expand the row. The row expands only when i click on (+) attached to every row. Am i missing anything? I am using 2.3.0 version

    Thanks again
    pbban

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Yes, Ext 2.3.0 didn't support that yet.

    You could change:
    Code:
    Ext.override(Ext.grid.RowExpander, {
        init : function(grid){
            this.grid = grid;
            var view = grid.getView();
            view.getRowClass = this.getRowClass.createDelegate(this);
            view.enableRowBody = true;
            grid.on('render', function(){
                //view.mainBody.on('mousedown', this.onMouseDown, this);
                grid.on('rowclick', this.onRowClick, this);
            }, this);
        },
        onRowClick: function(grid, rowIndex, e) {
            this.toggleRow(rowIndex);
        }
    });

  5. #5
    Sencha User
    Join Date
    Dec 2010
    Posts
    11
    Vote Rating
    0
    pbban is on a distinguished road

      0  

    Default


    Hi,

    Thanks for your reply. I am considering upgrading to Extjs 3.3.0 and have downloaded the same. However not able to find the RowExpander.js file in the directory structure.
    Would you be able to help me with the location for RowExpander.js

    Thanks
    Parag

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Code:
    examples/ux/RowExpander.js

  7. #7
    Sencha User
    Join Date
    Dec 2010
    Posts
    11
    Vote Rating
    0
    pbban is on a distinguished road

      0  

    Default


    Thanks a Ton for the super fast response

  8. #8
    Sencha User
    Join Date
    Dec 2010
    Posts
    11
    Vote Rating
    0
    pbban is on a distinguished road

      0  

    Default


    Quote Originally Posted by pbban View Post
    Thanks a Ton for the super fast response
    I have migrated to Extjs 3.3.0, and am able to perform the click operation on the rows. However not sure how i can remove the (+) symbol that appears with each row. Is there a way to remove that.

    Thanks
    Pbban

  9. #9
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    You can remove the image with CSS:
    Code:
    .x-grid3-row-expander {
        background: transparent;
    }
    or you could configure the entire expander with:
    Code:
    hidden:true

Similar Threads

  1. Row Expander - expand 1st row by default
    By deanoj in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 13 Aug 2009, 8:12 AM
  2. Grid + Row Expander + One Row at a time
    By Brat.Pidd in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 12 May 2009, 1:22 AM
  3. row expander
    By tunaboo in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 11 Jan 2008, 12:39 PM

Thread Participants: 1