Results 1 to 2 of 2

Thread: Refresh the gridpanel view inside a rowExpander

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    16

    Smile Refresh the gridpanel view inside a rowExpander

    I have a gridpanel with RowExpander. My requirement is to refresh the grid inside the rowExpander when a checkbox is clicked. I am able to update only 1 grid inside the rowExpander of one row. Please can anyone help me to figure out how to refresh all the grids. The code with rowExpander is below. Below top5FundsGrid is parentGrid that has rowxpander plugin and when its expanded we have another grid named fundHoldingsGrid is displayed. My requirement is to refresh the fundHoldingsGrid when checkbox is checked. Here I am not able to refresh all the rowExpander grids.
    Code:
    top5FundsStore = new Ext.data.GroupingStore({
             id: 'id',
             hidden: true,
             reader: new Ext.data.JsonReader({
                     root: 'top5Fundsrows',
                     totalProperty: 'top5FundsTotalRows',
                     fields: ['recId', 'a','b','c']
              }),
              sortInfo:{field: 'b', direction: "DESC"}
    });
                    
    expander = new Ext.ux.grid.RowExpander({});
                       
    top5FundsGrid = new Ext.grid.GridPanel({
              store: top5FundsStore,
              title: 'Top 5 Fund Holdings',
              autoScroll: true,
              flex: 4,
              cm: new Ext.grid.ColumnModel([expander, {
                    header: "Fund Name",
                    dataIndex: 'a'
              },{
                    id: 'b',
                    header: "AUM (USD)(mn)",
                    dataIndex: 'b',
                    renderer: numberValueRenderer
              },{
                    id: 'c',
                    header: "Portfolio Manager",
                    dataIndex: 'c',
                    renderer: tTipRenderer
              }]),
              view: new Ext.grid.GridView({
                  forceFit: true
              }),
              tools: [{
                       id: 'excel',
                       qtip: 'Export to Excel',
                       handler: function(event, toolEl, panel){
                           window.location = '/dbPortal/exce /generateExcel?excelForPage=ClientPresentation&excelForGrid=top5Funds';
                       }
               }],
               tbar: [{
                         text: 'Expand all',
                         handler: function() {
                             for(var x=0;x<top5FundsStore.getTotalCount();x++){
                                    expander.expandRow(x);
                             }
                         }
                      },
                      ' ',
                      {
                         text: 'Collapse all',
                         handler: function() {
                            for(var x=0;x<top5FundsStore.getTotalCount();x++){
                                expander.collapseRow(x);
                            }
                         }
                      }],
                      layout: 'anchor',
                      anchor: '98%',
                      autoHeight: true,
                      plugins: expander,
                      collapsible: true
              });
    
    var records = ' ';
    top5FundsGrid.on('click', function(e){
                              top5FundsGrid.suspendEvents();
     });
     top5FundsGrid.on('sortchange', function(grid, sortInfo){
                              records = ' ';
     });
    
    onExpand = function(expander, record, body, index){
              var recId = record.get("recId");
              if(records.indexOf(recId + "fundHolding") == -1){
                     fundHoldingsStore = new Rdr.data.DwrGroupingStore({
                            dwrFunction : DwrClientPresentationNew.loadFundHoldings,
                            id: 'id',
                            reader: new Ext.data.JsonReader({
                               totalProperty: 'total',
                               root: 'rows',
                               fields: ['a', 'b', 'c', 'd', 'e', 'f', 'g','stkName']
                            })
                     });
                     fundHoldingsStore.setBaseParam('recId',recId) ;
                     fundHoldingsStore.load();
                     fundHoldingsStore.on('load', function(store, array, options){
                          if(fundHoldingsStore.getTotalCount() > 0){
                               fundHoldingsGrid = new Ext.grid.GridPanel({
                                      store: fundHoldingsStore,
                                      cm: commonColModel,
                                      stripeRows: false,
                                      border: true,
                                      view: new Ext.grid.GridView({
                                             forceFit: true
                                      }),
                                      layout:'anchor',
                                      autoHeight: true,
                                      anchor: '98%',
                                      renderTo: body,
                                      border: true,
                                      titleCollapse: false,
                                      collapsible: false
                          });
                          records += recId + "fundHolding" + ";";
                           } 
                   });
            }
      }
                    
    expander.on('expand', onExpand);

  2. #2

    Default

    Did u find any solution?

Similar Threads

  1. gridpanel reconfigure, this.view is null prior having viewed the gridpanel
    By pppswing in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 30 Nov 2010, 7:00 AM
  2. how can I load grid inside RowExpander?
    By rohan.chandane in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 20 Aug 2010, 8:53 AM
  3. ActionListener for widgets inside RowExpander
    By arch_04in in forum Ext GWT: Discussion
    Replies: 15
    Last Post: 29 Mar 2010, 2:53 AM
  4. gridPanel.view.refresh() giving hassles
    By StevenMcD in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 13 Aug 2009, 4:54 AM
  5. Functions inside rowexpander does not work
    By Brad2009 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 13 Jan 2009, 6:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •