Threaded View

  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

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar