【发布时间】:2020-06-18 11:44:58
【问题描述】:
分机中有一个网格列表页面。
查看:
Ext.define('App.view.client.ClientListView', {
extend : 'Ext.container.Container',
xtype : 'client-list',
controller : 'client',
items:
[
{
xtype : 'panel',
title : 'Clients List',
items :
[
{
xtype : 'grid',
columns: [
{
text :'Mobile Number',
dataIndex : 'mobile',
},
{
text :'Email',
dataIndex : 'email',
}
],
store:Ext.create('dialgod.store.ClientStore'),
dockedItems:
[
{
xtype : 'pagingtoolbar',
dock : 'bottom',
displayInfo : true
},
{
xtype : 'toolbar',
height : 50,
docked : 'top',
items :
[
{
xtype : 'button',
text : 'Add Client',
name : 'btn_add_client',
}
]
}
]
}
]
}
]
});
控制器:
Ext.define('App.controller.ClientController', {
extend: 'Ext.app.ViewController',
alias: 'controller.client',
init: function() {
this.control({
'client-list':
{
activate : this.loadClientsList,
painted : this.loadClientsList
},
'client-list button[name=btn_add_client]':{
click : this.AddClientForm
},
});
},
loadClientsList: function(listObj)
{
console.log("loading client");
var storeObj = listObj.down("grid").getStore();
storeObj.load();
},
AddClientForm : function(){
console.log("client add form clicked");
}
所有的点击功能在这个控制器中工作正常。 激活、绘制都不起作用。 加载网格页面时,我无法控制此激活功能。所以没有初始化加载这个网格。所以任何激活的解决方案,涂漆的操作系统不正确或其他任何使用负载的方法?任何人都可以建议。
【问题讨论】:
-
你用的是extjs还是sencha-touch框架,什么版本?
标签: javascript html extjs sencha-touch