BUG 0000 PM tables - disabled data editing for Report tables
This commit is contained in:
@@ -14,11 +14,14 @@ var cmodel;
|
|||||||
var smodel;
|
var smodel;
|
||||||
var infoGrid;
|
var infoGrid;
|
||||||
var _fields;
|
var _fields;
|
||||||
|
var isReport;
|
||||||
|
|
||||||
Ext.onReady(function(){
|
Ext.onReady(function(){
|
||||||
|
|
||||||
pageSize = 20; //parseInt(CONFIG.pageSize);
|
pageSize = 20; //parseInt(CONFIG.pageSize);
|
||||||
|
|
||||||
|
isReport = tableDef.PRO_UID ? true : false;
|
||||||
|
|
||||||
newButton = new Ext.Action({
|
newButton = new Ext.Action({
|
||||||
text: _('ID_ADD_ROW'),
|
text: _('ID_ADD_ROW'),
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_add',
|
iconCls: 'button_menu_ext ss_sprite ss_add',
|
||||||
@@ -100,7 +103,9 @@ Ext.onReady(function(){
|
|||||||
deleteButton.disable();
|
deleteButton.disable();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
editButton.enable();
|
if (!isReport) {
|
||||||
|
editButton.enable();
|
||||||
|
}
|
||||||
deleteButton.enable();
|
deleteButton.enable();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -112,19 +117,21 @@ Ext.onReady(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//row editor for table columns grid
|
//row editor for table columns grid
|
||||||
editor = new Ext.ux.grid.RowEditor({
|
if (!isReport) {
|
||||||
|
editor = new Ext.ux.grid.RowEditor({
|
||||||
saveText: _("ID_UPDATE"),
|
saveText: _("ID_UPDATE"),
|
||||||
listeners: {
|
listeners: {
|
||||||
afteredit: {
|
afteredit: {
|
||||||
fn:function(rowEditor, obj, data, rowIndex ){
|
fn:function(rowEditor, obj, data, rowIndex ){
|
||||||
if (data.phantom === true) {
|
if (data.phantom === true) {
|
||||||
store.reload(); // only if it is an insert
|
store.reload(); // only if it is an insert
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var proxy = new Ext.data.HttpProxy({
|
var proxy = new Ext.data.HttpProxy({
|
||||||
//url: '../pmTablesProxy/getData?id=' + tableDef.ADD_TAB_UID
|
//url: '../pmTablesProxy/getData?id=' + tableDef.ADD_TAB_UID
|
||||||
@@ -158,16 +165,6 @@ Ext.onReady(function(){
|
|||||||
autoSave: true // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
|
autoSave: true // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
|
||||||
});
|
});
|
||||||
|
|
||||||
/*Ext.data.DataProxy.addListener('write', function(proxy, action, result, res, rs) {
|
|
||||||
PMExt.notify('UPDATE', 'the record was updated successfully.');
|
|
||||||
});*/
|
|
||||||
|
|
||||||
// load the store immeditately
|
|
||||||
//store.load();
|
|
||||||
|
|
||||||
//store.on('update', store._update, store);
|
|
||||||
|
|
||||||
|
|
||||||
cmodel = new Ext.grid.ColumnModel({
|
cmodel = new Ext.grid.ColumnModel({
|
||||||
defaults: {
|
defaults: {
|
||||||
width: 50,
|
width: 50,
|
||||||
@@ -211,8 +208,7 @@ Ext.onReady(function(){
|
|||||||
items: ['-',_('ID_PAGE_SIZE')+':',comboPageSize]
|
items: ['-',_('ID_PAGE_SIZE')+':',comboPageSize]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
infoGridConfig = {
|
||||||
infoGrid = new Ext.grid.GridPanel({
|
|
||||||
region: 'center',
|
region: 'center',
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
id: 'infoGrid',
|
id: 'infoGrid',
|
||||||
@@ -230,17 +226,17 @@ Ext.onReady(function(){
|
|||||||
},
|
},
|
||||||
store: store,
|
store: store,
|
||||||
cm: cmodel,
|
cm: cmodel,
|
||||||
plugins: [editor],
|
|
||||||
sm: smodel,
|
sm: smodel,
|
||||||
tbar:[newButton,'-',editButton, deleteButton,'-',importButton,{xtype: 'tbfill' }, backButton],
|
tbar:[newButton,'-',editButton, deleteButton,'-',importButton,{xtype: 'tbfill' }, backButton],
|
||||||
bbar: bbarpaging,
|
bbar: bbarpaging
|
||||||
/*listeners: {
|
}
|
||||||
//rowdblclick: EditPMTableRow,
|
|
||||||
render: function(){
|
if (!isReport) {
|
||||||
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING_GRID')});
|
infoGridConfig.plugins = new Array();
|
||||||
}
|
infoGridConfig.plugins.push(editor);
|
||||||
},*/
|
}
|
||||||
});
|
|
||||||
|
infoGrid = new Ext.grid.GridPanel(infoGridConfig);
|
||||||
|
|
||||||
infoGrid.on('rowcontextmenu',
|
infoGrid.on('rowcontextmenu',
|
||||||
function (grid, rowIndex, evt) {
|
function (grid, rowIndex, evt) {
|
||||||
|
|||||||
Reference in New Issue
Block a user