Results 1 to 6 of 6

Thread: Troubles with Grid Plugins - Expander v3.2

  1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    61

    Default Troubles with Grid Plugins - Expander v3.2

    Hi, I want to do something like the Grid Plugins Example in my GridPanel (wich is already working)

    I just created the variable before the grid:

    Code:
      var expander = new Ext.ux.grid.RowExpander({
       tpl : new Ext.Template(
        '<p><b>Processos Apensados:</b> {NumProc}</p><br>'
       )
      }); 
      //NumProc is one of the Grid's field
     
      grid = new Ext.grid.GridPanel({ ...
    and inserted the plugin:

    Code:
      height: 330,
      width: 575,
      plugins: expander,
    But I got a js error:
    "Mensagem: 'Ext.ux.grid.RowExpander' is null or not an object"

    Did I do somthing wrong?

    Thx

    I am using Ext JS Library 3.2.1
    Last edited by igor2000; 29 Nov 2010 at 3:47 AM. Reason: using Ext JS Library 3.2.1

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    All Ext.ux.* classes are not included in ext-all.js and need to be included separately from examples/ux.

    Don't forget that most ux'es also have their own css file that also needs to be linked.

  3. #3
    Sencha User
    Join Date
    Jul 2010
    Posts
    61

    Default

    ah ok, so I dont need to update my version, just link a file from examples/ux right?

  4. #4
    Sencha User
    Join Date
    Jul 2010
    Posts
    61

    Default

    OK, everything worked. But now I got a new problem:

    This grid had colored rows:

    Code:
     // Create grid view  
     var gridView = new Ext.grid.GridView({ 
        //forceFit: true, 
      getRowClass : function (row, index) { 
        var cls = ''; 
        var data = row.data; 
        if (data.Situacao == 'RECENTE') { 
         iRecente += 1;
         cls = 'laranja-row';
        } else if (data.Status == 'Retornado') {
         iVolta += 1;
         cls = 'beje-row' ;
        } else if (data.Situacao == 'RECEBER') {
         iReceber += 1;
         cls = 'blue-row';
        } else if (data.Situacao == 'MOVIMENTAR') {
         iMovimentar += 1;
         cls = 'green-row'; 
        } else if (data.Situacao == 'EXTERNO') {
         cls = 'blue-row' ;
        } else if (data.Situacao == 'ENCAMINHAR') {
         iEncaminhar += 1;
         cls = 'red-row' ;
        } else {
         iNormal += 1;
        }
     
        return cls; 
        } 
     });  //end gridView
    However after I implemented the plugin its colors disapeared...

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    Use:
    Code:
    var expander = new Ext.ux.grid.RowExpander({
      tpl : new Ext.Template(
        '<p><b>Processos Apensados:</b> {NumProc}</p><br>'
      ),
      getRowClass : function(record, rowIndex){
        var cls = ...; // your code here
        return this.constructor.prototype.getRowClass.apply(this, arguments) + ' ' + cls;
      }
    });

  6. #6
    Sencha User
    Join Date
    Jul 2010
    Posts
    61

    Default

    perfect!! thx man

Similar Threads

  1. Replies: 1
    Last Post: 24 Sep 2010, 10:05 AM
  2. Grid with Expander
    By Gillespie59 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 1 Jun 2010, 11:24 PM
  3. Grid with Expander
    By Gillespie59 in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 12 May 2010, 7:20 AM
  4. Grid troubles under IE7
    By edema in forum Ext 2.x: Help & Discussion
    Replies: 15
    Last Post: 18 Aug 2008, 11:55 PM
  5. Expander Grid
    By balaganesh_angler in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 26 May 2008, 7:32 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
  •