me["onBeforeItem" + map[newType]] is not a function
[在此错误处中断] (me['onBeforeItem' + m...record, item, index, e) === false) || ext-all-debug.js (第 66872 行)
前面我写的js调试也没发现错误,这样的怎么找到bug呢?求解,谢谢了。
解决方案 »
- 拾色器部分代码的疑问:)
- ext 获取panel autoLoad页面控件的值
- JS中怎么获取input所在页面的绝对坐标
- onUnload
- JS里变量和字符的连接.
- 用键盘和鼠标对li的选择进行操作
- 怎么样判断鼠标的cursor是move还是default??100分
- showModelessDialog打开的窗口如何通过cloneNode复制父窗口的一个表格对象?
- 有一组单选按钮(4个),如何在点击这组单选按钮中的另外一个按钮时知道之前选中的是那个按钮。
- wdApp = new ActiveXObject("Word.Application"); 代码出错 WHY??
- 错误 3 “" + result1[2] + "”不是有效标识符。
- 一个思路,不知道有没有解
用的是extjs4.0 Ext.onReady(function() { //创建对象模型
Ext.define('Item', {
extend: 'Ext.data.Model',
fields: [
{ name: 'MaterialId', type: 'int' },
{ name: 'MaterialCode', type: 'string' },
{ name: 'Quantity', type: 'int' }
]
});
//创建 子单的数据源
var Itemstore = Ext.create('Ext.data.JsonStore', {
storeId: 'simpsonsStore',
autoDestroy: true,
autoLoad: false,
model: 'Item',
fields: ['MaterialId', 'MaterialCode', 'Quantity'],
proxy: {
type: 'ajax',
url: '/WareHouseVoucherItem/Select',
reader: {
type: 'json',
root: 'rows',
totalProperty: 'totalCount'
}
}
});
//可编辑行的创建
var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: false
}); //从表添加mine
var grid = Ext.create('Ext.grid.Panel', {
title: '子单信息',
store: Itemstore,
autoHeight: true,
columns: [{
text: '物资编号',
dataIndex: 'MaterialId',
width: 130,
editor: {
xtype: 'textfield',
name: 'MaterialId',
id: 'MaterialId'
}
}, {
text: '数量',
dataIndex: 'Quantity',
width: 60,
editor: {
xtype: 'numberfield',
id: 'Quantity',
name: 'Quantity',
minValue: 1,
maxValue: 100000
}
}, {
text: '编号',
dataIndex: 'MaterialCode',
width: 120,
editor: {
id: 'MaterialCode'
}
}
],
region: 'center',
tbar: [{
text: '添加',
itemId: 'addItems',
handler: function() {
rowEditing.cancelEdit(); var r = Ext.ModelManager.create({
MaterialId: 1,
Quantity: 20,
MaterialCode: 'sfg001',
indoor: false
}, 'Item'); Itemstore.insert(0, r);
rowEditing.startEdit(0, 0);
}
}],
plugins: [rowEditing]
}); var center = { region: "center", split: true, border: false, items: grid, layout: "fit" };
new Ext.Viewport({ layout: "border", items: [center] });
});