Ext4.0.7使用Ext.grid.ColumnModel报错:TypeError: Ext.grid.Model is not a constructor
代码如下:
Ext.onReady(function(){
//定义列
var cm = new Ext.grid.ColumnModel([
{header: '编号', dataIndex: 'id'},
{header: '名称', dataIndex: 'name'},
{header: '描述', dataIndex: 'des'}
]);
//数据定义
var data = [
['1001','name1','description1'],
['1002','name1','description1'],
['1003','name1','description1'],
['1004','name1','description1'],
['1005','name1','description1']
];
//数据源定义
var store = new Ext.data.Store({
proxy: new Ext.data.MemoryProxy(data),
reader: new Ext.data.ArrayReader({},[
{name: 'id'},
{name: 'name'},
{name: 'des'}
])
});
store.load();
//grid panel
var grid = new Ext.grid.GridPanel({
renderTo: Ext.getBody(),
store: store,
cm: cm
});
});
google了一下:In Extjs 4.0 ,there is no colModel config for GridPanel(http://www.sencha.com/forum/showthread.php?199720-Ext.grid.ColumnModel-is-not-a-constructor)然后查看其API:其用法如下
Ext.onReady(function(){
Ext.create('Ext.data.Store', {
storeId: 'simpleStore',
fields: ['name', 'email', 'phone'],
data:{
'items':[
{'name':'yanshiying', 'email':'email', 'phone':'1234567890'},
{'name':'yanshiying', 'email':'email', 'phone':'1234567890'},
{'name':'yanshiying', 'email':'email', 'phone':'1234567890'}
]
},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});
Ext.create('Ext.grid.Panel', {
title: 'Simple',
store: Ext.data.StoreManager.lookup('simpleStore'),
columns: [
{header: 'Name', dataIndex: 'name'},
{header: 'Email', dataIndex: 'email'},
{header: 'Phone', dataIndex: 'phone'}
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});
})
运行效果:

Ext4.0.7使用Ext.grid.ColumnModel报错:TypeError: Ext.grid.Model is not a constructor的更多相关文章
- 安装php时,make步骤报错make: *** [ext/gd/gd.lo] Error 1
安装PHP时,make步骤报错make: *** [ext/gd/gd.lo] Error 1 /usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/ ...
- Selenium Grid 运行报错 Exception thrown in Navigator.Start first time ->Error forwarding the new session Empty pool of VM for setup Capabilities
Selenium Grid 运行报错 : Exception thrown in Navigator.Start first time ->Error forwarding the new se ...
- org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default version will be used.报错
org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default versio ...
- 将Xcode升级到10.0以上版本,Appium启动报错的问题
前言 现在的Xcode最新版本都是在10.1,原先使用的版本是9.4.1!结果今天手贱将其升级... 然后,跑IOS自动化时,出现“Xcode version '0.1'. Support for X ...
- django2.0+连接mysql数据库迁移时候报错
django2.0+连接mysql数据库迁移时候报错 情况一 错误信息 django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 ...
- django2.0变动数据库设置外键报错
1.报错TypeError: __init__() missing 1 required positional argument: 'on_delete' django2.0以后创建数据库外键的时候必 ...
- python 报错TypeError: 'range' object does not support item assignment,解决方法
贴问题 nums = range(5)#range is a built-in function that creates a list of integers print(nums)#prints ...
- 完美解决 scipy.misc.imread 报错 TypeError: Image data cannot be converted to float
File "/home/harrison/anaconda3/lib/python3.7/site-packages/matplotlib/image.py", line 634, ...
- 关于Jupyter Notebook无法自动补全(Autocompletion),报错TypeError: __init__() got an unexpected keyword argument 'column' 的解决方案
关于Jupyter Notebook无法自动补全(Autocompletion),报错TypeError: __init__() got an unexpected keyword argument ...
随机推荐
- 将主机IDS OSSEC日志文件存入MYSQL的方法
将主机IDS OSSEC日志文件存入MYSQL的方法 http://www.freebuf.com/articles/system/6139.html http://ossec-docs.readth ...
- Leetcode:LRUCache四个版本实现
题目 Design and implement a data structure for Least Recently Used (LRU) cache. It should support the ...
- windows上安装winsshd
winsshd下载地址:http://www.bitvise.com/ssh-server-download 安装后默认配置即可使用:
- js深入研究之自定义混合Mixin函数
<script type="text/javascript"> /* 增加函数 */ function augment(receivingClass, givingCl ...
- 基数---SQL Server 2008 Bible
关系类型 主要实体的键 次要实体的键 一对一 主要实体-主键-单个元组 主要实体-主键-单个元组 一对多 主要实体-主键-单个元组 次要实体-外键-多个元组 多对多 多个元组 多个元组
- 怎样用jQuery自带方法/函数来获取outerHTML属性
原文地址:http://jingyan.baidu.com/article/7f41ececf93b48593d095c25.html 包括我自己在内(其实我也就这两天才知道这样可以快速获取的),很多 ...
- SPOJ375.QTREE树链剖分
题意:一个树,a b c 代表a--b边的权值为c.CHANGE x y 把输入的第x条边的权值改为y,QUERY x y 查询x--y路径上边的权值的最大值. 第一次写树链剖分,其实树链剖分只能说 ...
- mysql 从data文件恢复数据库
安装在D:\mysql\mysql-5.6.24-winx64下的mysql 由于系统坏了,移到另外一台机器上启动 步骤如下 1.复制以前的mysql安装文件及data文件下:2.全新安装mysql3 ...
- laravel-模板引擎Blade
(慕课网_轻松学会Laravel-基础篇_天秤vs永恒老师) 一.概述 Blade是Laravel提供的一个既简单又强大的模板引擎 和其他流行的PHP模板引擎不一样,Blade并不限制你在视图view ...
- Salt安装
salt-master安装 [salt-master]# yum install salt-master 或者 curl -L http://bootstrap.saltstack.org | sud ...