PDA

View Full Version : Doubt about RowExpander + Ext.Template



eduardolagares
10 Jul 2010, 7:36 PM
Good night,I have some problems In use the Ext.Template with RowExpander plugin

Look my codes:

data of store




{
"results":
[
{
"id":7,
"rentalAgreement":1,
"amount":"1.00","value":"1.00","valueExceeded":"1.00","valueExceededMetricUnit":1,
"franchiseType":2,"valueProduction":"123123.00","valueProductionMetricUnit":1,"excluded":null,
"franchiseTypeName":"Copia e Impress\u00e3o Colorido","productFranchise":[]},{"id":8,"rentalAgreement":1,
"amount":"123.00","value":"123.00","valueExceeded":"123123.00",
"valueExceededMetricUnit":1,"franchiseType":2,"valueProduction":"8888.00","valueProductionMetricUnit":1,
"excluded":null,"franchiseTypeName":"Copia e Impress\u00e3o Colorido",
"productFranchise":[
{
"id":73,"product":307,
"rentalAgreementFranchise":8,"productMeterType":33,"excluded":null,"meterTypes":"{33,33,33,33}",
"productSerialNumber":"100000","productName":"Produto Padr\u00e3o de Teste","productModel":"vs001",
"productGroupName":"Impressoras"
}
]
}
],
"totalResults":"2"
}
code


var tpl = new Ext.Template(
'<p>{franchiseTypeName}</p>',
'<p><tpl for="productFranchise">',
'<tpl><p>{#} {productName}, {id}, {product}</p></tpl>',
'</tpl></p>'
);

var expander = new Ext.ux.grid.RowExpander({
tpl : tpl
});


result:
21385

How you can see, the program does not execute the "for" of template, and does not access the properties of "productFranchise",
The id showed in the tpl is of record and not of sub-record

Condor
11 Jul 2010, 11:58 AM
What is that empty <tpl>...</tpl> doing in your template?

eduardolagares
11 Jul 2010, 1:21 PM
Sorry I was basing on this example: http://www.sencha.com/deploy/dev/examples/core/templates.html but I have just realized that for this case, it uses the Ext.XTemplate and not the Ext.Template, sorry, but using the XTemplate it works fine. Thanks Condor