T使用ExtJS4.0.1,MVC架构编写代码.当我开发主要表单时,我遇到了网站搜索扩展的问题.
当我试图在控制器中创建新的小部件时,我需要在子面板中渲染结果.所以当我编写示例代码时,我会遇到以下问题:
**Uncaught TypeError: Object [object Object] has no method 'setSortState'**
Run Code Online (Sandbox Code Playgroud)
我无法理解为什么它会给出错误信息.我需要一些帮助来解决这个问题.
下面我想展示我的代码:
//Panel which is showing to user
Ext.define('Semantics.view.main.menuView', {
extend: 'Ext.panel.Panel',
layout: 'fit',
alias: 'widget.Menu',
title: "",
tbar: [
{
//search field
name:'mainSearchText',
id:'mainSearchText',
xtype: 'textfield',
defaultValue: 'Search',
height: 20
},
{
name:'mainSearchButton',
id:'mainSearchButton',
xtype: 'button',
text: 'Find',
height: 20
}
]
});
//controller for search request
Ext.define('Semantics.controller.main.mainController', {
extend: 'Ext.app.Controller',
views: ['main.menuView','mainSearch.MainSearchResultForm'],
refs: [
{ ref: 'menuPanel', selector: 'Menu' },
{ ref:'mainSearchText',selector:'#mainSearchText'},
{ref: 'mainSearchForm',selector:'#mainSearchForm'},
{ref:'MainSearchGrid',selector:'#MainSearchGrid'}
],
init: …Run Code Online (Sandbox Code Playgroud)