Closed MichaelF77 closed 6 years ago
Hi, here is the only way to do that:
GigaTables plug-in has 2 types of triggers triggerBefore and triggerAfter which can be applied to any action button - Create, Edit or Delete.
an example of usage is in the settings config:
tableOpts: {
buttons: [
{extended: "editor_create", editor: editor, triggerAfter: (function () {
console.log('after create');
}), triggerBefore: (function () {
console.log('before create');
})},
{extended: "editor_edit", editor: editor},
{extended: "editor_remove", editor: editor, triggerAfter: (function () {
console.log('after del');
})}
],
buttonsPosition: ['top', 'bottom'],
theme: 'std'
}
I figured out how to force refresh using following snippet:
reloadGrid() { loadData() .then( (data) => { let jsonData = data['rows'] ? data['rows'] : data['row']; // one row or several this.reviewGrid.jsonData = jsonData; this.reviewGrid.createTable(jsonData); this.reviewGrid.setTableSort(); }) }
Thanks for great work !
Is there a way to force reload from ajax API based on some external event or state, but not automatically.