1. #1
    Ext JS Premium Member
    Join Date
    Apr 2008
    Location
    Oslo
    Posts
    64
    Answers
    2
    Vote Rating
    0
    mikhailt is on a distinguished road

      0  

    Question Answered: How to combine XTemplate and custom renderer? in RowExpander

    Answered: How to combine XTemplate and custom renderer? in RowExpander


    I use RowExpander plugin with a template.
    How to use renderer function in the template?
    Code:
    REDrenderer = function(nValue) 
    {
        var retValue = nValue;
        if (nValue < threshold)
        {
            retValue = "<font style='color:red;'>" + nValue.toString() + "</font>";        
        }  
        return retValue;
    };
    
    
       Ext.create('Ext.grid.Panel', {
                store: mystore,
                columns: [
                    {
                        header     : 'AAA',
                        dataIndex: 'aaa1',
                        renderer: REDrenderer 
                    }
                ],
    
                plugins: [
                    {
                        ptype: 'rowexpander',
                        rowBodyTpl : [ '<div>{aaa1}</div>' ] //NEED to call REDrenderer() here!
                    }
                ]
            });
    I want to see value red in expanded template using defined renderer.

  2. Try:

    Code:
    // sorry, just prefer not to declare global functions if I can avoid it!
    var app = {};
    app.REDrenderer = function(nValue) 
                          {
                              var retValue = nValue;
                              if (nValue < threshold)
                              {
                                  retValue = "<font style='color:red;'>" + nValue.toString() + "</font>";        
                              }  
                              return retValue;
                          };    
    
    
    
    
    Ext.create('Ext.grid.Panel', {
            store: mystore,
            columns: [
                {
                    header     : 'AAA',
                    dataIndex: 'aaa1',
                    renderer: app.REDrenderer 
                }
            ],
    
    
            plugins: [
                {
                    ptype: 'rowexpander',
                    rowBodyTpl :  '<div>{[app.REDrenderer(values.aaa1);]}</div>'
                }
            ]
        });

    stevil

  3. #2
    Ext JS Premium Member stevil's Avatar
    Join Date
    Nov 2007
    Location
    Denver, CO
    Posts
    1,045
    Answers
    15
    Vote Rating
    9
    stevil will become famous soon enough

      0  

    Default


    Try:

    Code:
    // sorry, just prefer not to declare global functions if I can avoid it!
    var app = {};
    app.REDrenderer = function(nValue) 
                          {
                              var retValue = nValue;
                              if (nValue < threshold)
                              {
                                  retValue = "<font style='color:red;'>" + nValue.toString() + "</font>";        
                              }  
                              return retValue;
                          };    
    
    
    
    
    Ext.create('Ext.grid.Panel', {
            store: mystore,
            columns: [
                {
                    header     : 'AAA',
                    dataIndex: 'aaa1',
                    renderer: app.REDrenderer 
                }
            ],
    
    
            plugins: [
                {
                    ptype: 'rowexpander',
                    rowBodyTpl :  '<div>{[app.REDrenderer(values.aaa1);]}</div>'
                }
            ]
        });

    stevil

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi