目的: V20304A – [工時提列] – 若工時已登錄,則Grid 設為唯讀,不可修改
處理說明:{
header: "備註", dataIndex: "REMARK", width: 250, sortable: false, TMType: "string",
editor: { xtype: 'textfield', allowBlank: true }, //允許空白
},
grid_id: 'sub_Grid',
columns: sub_Columns,
//autoScroll: true,
flex: 1,
store: Ext.create('gridstore', { model: sub_model }),
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', { // 不會出現[Update][Cancel]鈕, 直接編輯
clicksToEdit: 1, // 按一下進行編輯,預設為按兩下
clicksToMoveEditor: 1, //在編輯模式下切換編輯另一行的行為1表示點選一就切換; //2表示點2下才切換。
})],
//})],
return false; // 禁止編輯
});
var sub_Grid = Ext.create('TMGrid', {
grid_id: 'sub_Grid',
columns: sub_Columns,
//autoScroll: true,
flex: 1,
store: Ext.create('gridstore', { model: sub_model }),
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', { // 不會出現[Update][Cancel]鈕, 直接編輯
clicksToEdit: 1, // 按一下進行編輯,預設為按兩下
clicksToMoveEditor: 1, //在編輯模式下切換編輯另一行的行為1表示點選一就切換; //2表示點2下才切換。
})],
//})],
});
2>> Grid 欄位唯讀, 不可編輯
//2025/02/21 , OPHR='N',仍列出工時,以便使用者查詢,但唯讀,不可修改
if (par_OPHR == "N") {
Ext.getCmp("sub_V20304A_OkBtn").setVisible(false);
//Ext.getCmp("sub_Grid").plugins = [];
//var grid = new Ext.grid.EditorGridPanel({
Ext.getCmp("sub_Grid").on("beforeedit", function (editor, context) {
return false; // 禁止編輯
});
}