Results 1 to 3 of 3

Thread: Dynamically added row expander Body template not rendered when grid panel refreshes.

  1. #1
    Sencha User
    Join Date
    Jun 2017
    Posts
    7
    Vote Rating
    0
      0  

    Default Dynamically added row expander Body template not rendered when grid panel refreshes.

    Hello everyone,
    I am using the grid panel with row expander plugin.When the row is expanded I am adding a nested grid in the row body template using the expandbody event in my controller. This all works fine but when there is any event that refreshes the parent grid panel such as paging tool bar navigation, the nested grid in the row expander body that was initially rendered is not render any more. How can I keep the nested grid panel even after the parent grid panel refreshes.


    Below is my code


    Code:
    //Row expander plugin where the nested grid is rendered.
    plugins: [{
        ptype: 'rowexpander',
        expandOnDblClick: false,
        selectRowOnExpand: false,
        tooltip : 'Activities',
        rowBodyTpl : ['<div id="myrow-{id}"></div>']
    }]
    Code:
    //Function called when  the row is expanded
    onRowExpanded:function(rowNode,record, expandbody){
            var rowContainerId = "myrow-"+record.id;
            var nestedGridId = "myGrid-"+record.id;
    
            var check = Ext.getCmp(nestedGridId);
            if(!check) {
                var tasks = Ext.create('APP.view.main.tasksGrid', {
                    id: nestedGridId
                });
                tasks.render(rowContainerId);
            }}

  2. #2
    Sencha Premium User
    Join Date
    Feb 2010
    Location
    Chicago
    Posts
    58
    Answers
    14
    Vote Rating
    11
      0  

    Default

    I would suggest using the grid plugin RowWidget.

    Quick example fiddle:

  3. #3
    Sencha User
    Join Date
    Jun 2017
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Thanks Johnny for the reply I am gonna try it out.

Similar Threads

  1. [CLOSED] Checkboxes not rendered correctly when added dynamically
    By jgroth in forum Ext:Bugs
    Replies: 2
    Last Post: 7 Aug 2012, 2:01 PM
  2. Replies: 0
    Last Post: 29 Jul 2011, 10:59 PM
  3. Replies: 8
    Last Post: 10 Sep 2009, 5:07 PM
  4. Replies: 2
    Last Post: 6 Aug 2009, 1:20 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
  •