BUG 8667 "copy, dentro de calendar, muestra un mensaje e.." UPDATE 1

- problemm found before delete work hour row
- problem fixed on validation
This commit is contained in:
Erik Amaru Ortiz
2012-05-06 19:59:58 -04:00
parent 4a025e4382
commit 6fd2777a24

View File

@@ -346,6 +346,19 @@ Ext.onReady( function() {
grid = new Ext.grid.GridPanel( { //grid work days grid = new Ext.grid.GridPanel( { //grid work days
store: store, store: store,
sm: new Ext.grid.RowSelectionModel({
selectSingle: true,
listeners:{
selectionchange: function(sm) {
if (sm.getCount() == 0) {
Ext.getCmp('btnRemove').setDisabled(true);
}
else {
Ext.getCmp('btnRemove').setDisabled(false);
}
}
}
}),
id: "gridCalendar", id: "gridCalendar",
width: 470, width: 470,
height : 150, height : 150,
@@ -377,17 +390,17 @@ Ext.onReady( function() {
ref: '../removeBtn', ref: '../removeBtn',
iconCls: 'icon-user-delete', iconCls: 'icon-user-delete',
text: _('ID_REMOVE'), text: _('ID_REMOVE'),
disabled: false, id: 'btnRemove',
disabled: true,
handler: function(){ handler: function(){
editor.stopEditing(); editor.stopEditing();
var s = grid.getSelectionModel().getSelections(); var record = grid.getSelectionModel().getSelected();
// console.log( 's[i]=', s[i].data.name); records = grid.getStore();
for(var i = 0, r; r = s[i]; i++){
if(s[i].data.name!='- ALL -') if (record.data.name == '- ALL -' && records.getCount() === 1)
store.remove(r); PMExt.error( _('ID_ERROR'), _('ID_NODELETEOPTIONALL'));
else else
PMExt.error( _('ID_ERROR'), _('ID_NODELETEOPTIONALL')); store.remove(record);
}
} }
}], }],