amcsi
10 Sep 2010, 1:34 AM
I'm using DataView and when I select a node, it doesn't fire selectionchange!
here's the html: http://amcsi.jgypk.hu/layout/dataViewTest.html
here's the js: http://amcsi.jgypk.hu/layout/script/dataViewTest.js
here's the code, if you don't want to read the js:
function begin() {
Ext.ns('Ext.ux.layout');
var postFields = [
{name: 'contentText', mapping: 'ContentText'},
]
var postStore = new Ext.data.XmlStore({
record: 'Posts Post',
totalProperty: 'PostView Posts',
fields: postFields,
url: 'xml/sample_postview.xml'
})
postStore.load()
var postTpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="post" id="post_{#}">',
'<span>{contentText}</span>',
'</div>',
'</tpl>'
)
var dv
dv = new Ext.DataView({
itemSelector: 'div.post',
overClass: 'post-over',
autoHeight:true,
cls: 'left_box',
store: postStore,
tpl: postTpl,
listeners: {
selectionchange: {
fn: function (dv, nodes) {
alert('it works!')
}
},
}
})
dv.render(document.body)
}
please help :(
here's the html: http://amcsi.jgypk.hu/layout/dataViewTest.html
here's the js: http://amcsi.jgypk.hu/layout/script/dataViewTest.js
here's the code, if you don't want to read the js:
function begin() {
Ext.ns('Ext.ux.layout');
var postFields = [
{name: 'contentText', mapping: 'ContentText'},
]
var postStore = new Ext.data.XmlStore({
record: 'Posts Post',
totalProperty: 'PostView Posts',
fields: postFields,
url: 'xml/sample_postview.xml'
})
postStore.load()
var postTpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="post" id="post_{#}">',
'<span>{contentText}</span>',
'</div>',
'</tpl>'
)
var dv
dv = new Ext.DataView({
itemSelector: 'div.post',
overClass: 'post-over',
autoHeight:true,
cls: 'left_box',
store: postStore,
tpl: postTpl,
listeners: {
selectionchange: {
fn: function (dv, nodes) {
alert('it works!')
}
},
}
})
dv.render(document.body)
}
please help :(