目的: V20304A –sub_Grid –[需求工時]欄位,為數字欄位且允許編輯
處理說明:1>Grid 設定為每行編輯模式
var sub_Grid = Ext.create('TMGrid', {
plugins: [
Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 1,
clicksToMoveEditor: 2,
autoCancel: false
})],
});
plugins: [
Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 1,
clicksToMoveEditor: 2,
autoCancel: false
})],
});
2>Grid.[需求時數][備註] 欄位設定可編輯
{
header: "需求工時", dataIndex: "RQHR", width: 70, sortable: false, align: "right", TMType: "float",
renderer: Ext.util.Format.numberRenderer('000.00'),
editor: { xtype: 'numberfield', allowBlank: true }, //允許空白
},
{
header: "備註", dataIndex: "REMARK", width: 250, sortable: false, TMType: "string",
editor: { xtype: 'textfield', allowBlank: true }, //允許空白
},
header: "需求工時", dataIndex: "RQHR", width: 70, sortable: false, align: "right", TMType: "float",
renderer: Ext.util.Format.numberRenderer('000.00'),
editor: { xtype: 'numberfield', allowBlank: true }, //允許空白
},
{
header: "備註", dataIndex: "REMARK", width: 250, sortable: false, TMType: "string",
editor: { xtype: 'textfield', allowBlank: true }, //允許空白
},
1>*.js - V20304A.js
var sub_Grid = Ext.create('TMGrid', {
grid_id: 'sub_Grid',
columns: sub_Columns,
flex: 1,
store: Ext.create('gridstore', { model: sub_model }),
plugins: [
Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 1,
clicksToMoveEditor: 2,
autoCancel: false
})],
});
2>V20304A_JSON.js
var sub_Columns = [{ header: "", xtype: "rownumberer", width: 40, align: "center", sortable: false },
{ header: "AMM項次", dataIndex: "AMINO", width: 80, sortable: false, TMType: "string" },
{ header: "項次", dataIndex: "ITMNO", width: 70, sortable: false, TMType: "string" },
{ header: "工作項目", dataIndex: "WKDESC", width: 150, sortable: false, TMType: "string" },
{
header: "標準工時", dataIndex: "STDHR", width: 70, sortable: false, align: "right", TMType: "float",
renderer: Ext.util.Format.numberRenderer('0,000.00')
},
{
header: "需求工時", dataIndex: "RQHR", width: 70, sortable: false, align: "right", TMType: "float",
renderer: Ext.util.Format.numberRenderer('000.00'),
editor: { xtype: 'numberfield', allowBlank: true }, //允許空白
},
{
header: "備註", dataIndex: "REMARK", width: 250, sortable: false, TMType: "string",
editor: { xtype: 'textfield', allowBlank: true }, //允許空白
},
//{ header: "件號專用表單編號", dataIndex: "PNSHTNO", width: 500, sortable: false, TMType: "string" }
];
沒有留言:
張貼留言