Your answer works. But it's not exactly what i want.
Cause i tought it would have another behaviour.
I will explain it in detail:
I wanted this functionality. To set "personalized" events as default.
BUT in some cases, in some grids, i want to have a "local" or a "unique" functionality in a event in a single Grid.
Example:
I will use the wireEvents to set my "personalized" default DataBound event:
function DataBound(args) {
console.log('DataBound');
//Change the Edit/Confirm dialog overlay to body in all Grids.
dialog = this.element.querySelector("[id$='EditConfirm']");
if (dialog)
dialog.ej2_instances[0].targetEle = document.querySelector('body');
//Change the Edit/Alert dialog overlay to body in all Grids.
dialog = this.element.querySelector("[id$='EditAlert']");
if (dialog)
dialog.ej2_instances[0].targetEle = document.querySelector('body');
}
All my Grids will apply this behaviour.
But i have one Grid where i want the totals to be above the lines, so in the view i have:
@Html.EJS().Grid("GridDebitosClientes")
...
.DataBound("DataBoundDebitosClientes")
(script)
function DataBoundDebitosClientes(args) {
console.log('DataBoundDebitosClientes');
//Puts the totals row above lines.
//From: https://www.syncfusion.com/forums/150174/aggregate-row-on-first-row-not-footer
this.getHeaderContent().append(this.getFooterContent());
//Call the default behaviour of DataBound.
DataBound.call(this.element.ej2_instances[0], args);
}
function DataBoundDebitosClientes(args) {
console.log('DataBoundDebitosClientes');
//totals row above data rows
//From: https://www.syncfusion.com/forums/150174/aggregate-row-on-first-row-not-footer
this.getHeaderContent().append(this.getFooterContent());
//Apply the default behaviour
DataBound.call(this.element.ej2_instances[0], args);
}
(/script)
The problem i have with your solution is that the DataBoundDebitosClientes event gets replace by the default DataBound when javascript 'this.on('content-ready', function () { ...' occur.
Isn't there another way to set the name of the events the Grid calls, like in the EJ1 version?
To have "personalized" events by default, but replace them anywhere i want, and call them if i want...