【发布时间】:2016-11-17 19:46:58
【问题描述】:
使用Ext.DataView时如何获取selection change上的记录?
我想在 selectionchange 事件函数中获取值 'IdPrd'。
var tpl_ram = new Ext.XTemplate(
'<ul>',
'<tpl for=".">',
'<li class="phone">',
'<img width="64" height="64" src="data/catalogo/ramos/imagenes/{IdRm}/{IdRm}.jpg" />',
'<strong>{NomRm}</strong>',
'<span>{DescRm}</span>',
'</li>',
'</tpl>',
'</ul>');
var ramos_dw = new Ext.DataView({
tpl: tpl_ram,
store: ramos_productos,
id: 'ramos_dw',
itemSelector: 'li.phone',
overClass: 'phone-hover',
singleSelect: true,
autoScroll: true,
autoHeight: true,
emptyText: 'SIN RESULTADOS QUE MOSTRAR',
listeners: {
'click': function() {},
selectionchange: {
fn: function(dv, nodes) {
//i want on selection get value 'IdPrd'
var record = nodes[0];
console.log("advert id - " + record.get('IdPrd'))
}
}
}
});
【问题讨论】:
标签: javascript extjs extjs3