如略所示,由于某些需要,需要在刷新之前,进行其它赋值操作。
我试了下,在grid中的兼听,发现无效果,不知道该如何写?Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: teststore,
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 200,
width: 400,
listeners:{
beforeshow: function(component, eOpts)
{
//在这里写刷新前操作,发现无效,换了其它几个,也不行。
}
}, renderTo: Ext.getBody()
});请大虾指点
我试了下,在grid中的兼听,发现无效果,不知道该如何写?Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: teststore,
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 200,
width: 400,
listeners:{
beforeshow: function(component, eOpts)
{
//在这里写刷新前操作,发现无效,换了其它几个,也不行。
}
}, renderTo: Ext.getBody()
});请大虾指点
bbar: Ext.create('Ext.PagingToolbar', {
store: store,id:'pagetoolbar',
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
listeners:{render:function(bar,opts){
function check(e){
e=e||event;
window.objclick=e.srcElement||e.target;
}
var dom=bar.getEl().dom;
if(dom.addEventListener)dom.addEventListener('mousedown',check,false);
else if(dom.attachEvent)dom.attachEvent('onmousedown',check);
},beforechange:function(){
if(window.objclick){
var cls=window.objclick.getElementsByTagName('span')[1].className;
if(cls.indexOf('x-tbar-page-first')!=-1)alert('点击了首页按钮');
else if(cls.indexOf('x-tbar-page-prev')!=-1)alert('点击了上一页按钮');
else if(cls.indexOf('x-tbar-page-next')!=-1)alert('点击了下一页按钮');
else if(cls.indexOf('x-tbar-page-last')!=-1)alert('点击了尾页按钮');
else if(cls.indexOf('x-tbar-loading')!=-1)alert('点击了刷新按钮');
}
else alert('通过输入框回车后更改数据源!');
}}/*,
items:[
'-', {
text: 'Show Preview',
pressed: pluginExpanded,
enableToggle: true,
toggleHandler: function(btn, pressed) {
var preview = Ext.getCmp('gv').getPlugin('preview');
preview.toggleExpanded(pressed);
}
}]*/
})