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
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",
width: 470,
height : 150,
@@ -377,17 +390,17 @@ Ext.onReady( function() {
ref: '../removeBtn',
iconCls: 'icon-user-delete',
text: _('ID_REMOVE'),
disabled: false,
id: 'btnRemove',
disabled: true,
handler: function(){
editor.stopEditing();
var s = grid.getSelectionModel().getSelections();
// console.log( 's[i]=', s[i].data.name);
for(var i = 0, r; r = s[i]; i++){
if(s[i].data.name!='- ALL -')
store.remove(r);
else
PMExt.error( _('ID_ERROR'), _('ID_NODELETEOPTIONALL'));
}
editor.stopEditing();
var record = grid.getSelectionModel().getSelected();
records = grid.getStore();
if (record.data.name == '- ALL -' && records.getCount() === 1)
PMExt.error( _('ID_ERROR'), _('ID_NODELETEOPTIONALL'));
else
store.remove(record);
}
}],