save / restore current editor.on event
save / restore current editor.on event
Hi @all I'm a little bit tired this evening.
What is the way to preserve actual event function and restore it after an action (as button action)
extend: 'selected',
text: '->URSSAF',
action: function() {
// demander la période URSSAF
// var rows = table.rows( { selected: true } ).indexes();
var OE = editor.on('open');
var OC = editor.on('close');
editor
.hide()
.show('recettes.MoisUrssaf')
.off('open')
.edit(table.rows( { selected: true } ).indexes(), {
title: 'Déclaration URSSAF',
buttons: [{
label: 'Enregistrer',
className: 'btn-primary',
fn: function () {
this.submit();
}
},
{
label: 'Annuler',
className: 'btn-primary',
fn: function () {
this.close();
}
}]
})
.set( 'recettes.MoisUrssaf', '2020/12' )
.on('close', function () {
editor.show()
table.buttons( 1, 8 ).disable();
editor.on('open',function(){OE});
editor.on('close',function(){OC});
})
}
Thanks
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You're tired, I'm drunk, we'll make a formidable team!
I'm not too clear on the question (possibly due to previous sentence!), but you may want to look at
one()
, as this may help structure your code.Colin
Hi @colin


Thanks for all sentence.
@colin
More question... Jameson, Paddy, else ?
Brewdog beer mostly
!