Extjs 如何得到grid中某一列的值
Mable 2012-05-24 10:46:00 Extjs 如何得到grid中某一列的值
var simpsonsStore=Ext.create('Ext.data.Store', {
storeId : 'simpsonsStore',
fields : [ 'operation', 'stockUpId', 'stockUpName', 'specifications',
'number', 'unitPrice', 'purchasingPrice', 'tax', 'amount',
'explain' ],
data : {
'items' : [ {
'operation' : 'operation1',
'stockUpId' : 'stockUpId1',
'stockUpName' : 'stockUpName1',
'specifications' : 'specifications1',
'number' : 'number1',
'unitPrice' : 'unitPrice1',
'purchasingPrice' : 'purchasingPrice1',
'tax' : 'tax1',
'amount' : 'amount',
'explain' : 'explain'
}, {
'operation' : 'operation2',
'stockUpId' : 'stockUpId2',
'stockUpName' : 'stockUpName2',
'specifications' : 'specifications2',
'number' : 'number2',
'unitPrice' : 'unitPrice2',
'purchasingPrice' : 'purchasingPrice2',
'tax' : 'tax2',
'amount' : 'amount',
'explain' : 'explain'
}, {
'operation' : 'operation3',
'stockUpId' : 'stockUpId3',
'stockUpName' : 'stockUpName3',
'specifications' : 'specifications',
'number' : 'number',
'unitPrice' : 'unitPrice',
'purchasingPrice' : 'purchasingPrice',
'tax' : 'tax',
'amount' : 'amount',
'explain' : 'explain'
}, {
'operation' : 'operation4',
'stockUpId' : 'stockUpId4',
'stockUpName' : 'stockUpName4',
'specifications' : 'specifications',
'number' : 'number',
'unitPrice' : 'unitPrice',
'purchasingPrice' : 'purchasingPrice',
'tax' : 'tax',
'amount' : 'amount',
'explain' : 'explain'
}, {
'operation' : 'operation5',
'stockUpId' : 'stockUpId5',
'stockUpName' : 'stockUpName5',
'specifications' : 'specifications',
'number' : 'number',
'unitPrice' : 'unitPrice',
'purchasingPrice' : 'purchasingPrice',
'tax' : 'tax',
'amount' : 'amount',
'explain' : 'explain'
} ]
},
proxy : {
type : 'memory',
reader : {
type : 'json',
root : 'items'
}
}
});
var zlGrid = Ext.create('Ext.grid.Panel', {
store : Ext.data.StoreManager.lookup('simpsonsStore'),
columns : [ {
header : '操作',
dataIndex : 'operation'
}, {
header : '货存编号',
dataIndex : 'stockUpId'
}, {
header : '货存名称',
dataIndex : 'stockUpName'
}, {
header : '规格型号',
dataIndex : 'specifications'
}, {
header : '数量',
dataIndex : 'number'
}, {
header : '单价',
dataIndex : 'unitPrice'
}, {
header : '采购额',
dataIndex : 'purchasingPrice'
}, {
header : '税额',
dataIndex : 'tax'
}, {
header : '金额',
dataIndex : 'amount'
}, {
header : '说明',
dataIndex : 'explain'
} ],
height : 200,
width : '100%',
renderTo : 'zlItemGrid'
});