日期:2014-05-20 浏览次数:20795 次
var strSex = new Ext.data.SimpleStore({
fields: ['value', 'name'],
data : [
['1', '男'],
['2', '女']
]
});
var objSex = new Ext.form.ComboBox({
hideLabel: true,
lazyRender: true, //值为true时阻止ComboBox渲染直到该对象被请求
store: strSex,
displayField: "name",
valueField: "value",
mode: "local",
editable: false,
triggerAction: "all"
});
var gridColumns = new Ext.grid.ColumnModel([//列模式
_sm,
{ header: "ID", dataIndex: "id", hidden: true },
{ header: "姓名", dataIndex: "name", editor: objEditname },
{ header: "性别", dataIndex: "sex", editor: objSex }
]);
var grid = new Ext.grid.EditorGridPanel ({//数据显示面板
border: false,
loadMask: true,
clicksToEdit:2,
width: 500,
height: 300,
store: store,
sm: _sm,
cm: gridColumns,
clicksToEdit: 2,
bbar: grid_bbar,
region:'center'//border布局必须
});