作为“目标” handler工具栏按钮,控制器的方法?
你好!
我希望这个处理程序“handler:onEventControler(???)”从视图中删除(它不属于那里)
对于网格视图设置dockedItems这个cod:
this.dockedItems = [{
xtype: 'toolbar',
items: [{
xtype: 'newstation'
},{
id: 'add-persone-btn',
xtype: 'button',
itemId: 'add',
text: 'Add',
iconCls: 'icon-add',
handler: onEventControler(???)
}, '-', {
itemId: 'delete',
text: 'Delete',
iconCls: 'icon-delete',
disabled: true,
handler: function(){
var selection = grid.getView().getSelectionModel().getSelection()[0];
if (selection) {
store.remove(selection);
}
}
}]
}]
我也尝试实现一个 this.control,但我无法要求按钮选择器查询。
我如何正确尊重 mvc extJs4 架构?
谢谢。
Hello!
I want this handler "handler: onEventControler (???)" removed from view (it do not belong there)
For grid view set dockedItems this cod:
this.dockedItems = [{
xtype: 'toolbar',
items: [{
xtype: 'newstation'
},{
id: 'add-persone-btn',
xtype: 'button',
itemId: 'add',
text: 'Add',
iconCls: 'icon-add',
handler: onEventControler(???)
}, '-', {
itemId: 'delete',
text: 'Delete',
iconCls: 'icon-delete',
disabled: true,
handler: function(){
var selection = grid.getView().getSelectionModel().getSelection()[0];
if (selection) {
store.remove(selection);
}
}
}]
}]
I also tried to implement a this.control, but I could not ask for a button selectorQuery.
How do I properly respecting the architecture mvc extJs4?
thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够在此视图的控制器内执行类似的操作。
处理程序:
或者,您可以在按钮上使用“操作”配置。
然后你可以:
http://docs .sencha.com/ext-js/4-0/#!/api/Ext.button.Button
You should be able to do something like this inside the controller of this view.
Handler:
Alternatively, you could use an "action" config on your button.
Then you could have:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.button.Button
这是视图 gridd 视图的方法“initComponent”:
This is method "initComponent" for view gridd view: