// Grid’s dataBound event function
onDataBound() {
this.grid.pagerModule.pagerObj.enablePagerMessage = false;
} |
// Grid’s dataBound event function
onDataBound() {
if (this.flag) {
.
.
// Creates instance for an EJ2 button
var buttonObj = new Button({
content: "Columns"
})
// Create a button element and bind click event for it
var button = document.createElement('button');
button.id = "columnChooser";
button.onclick = this.buttonClick.bind(this);
button.style.marginLeft = "92%";
// Append the EJ2 button instance to the created button element
buttonObj.appendTo(button);
// Insert the button element as child of pager element
(this.grid.pagerModule as any).element.insertBefore(button, (this.grid.pagerModule as any).element.querySelector('.e-parentmsgbar'))
this.flag = false;
// Bind open event to the column chooser module
(this.grid.columnChooserModule as any).dlgObj.open = this.columnChooserOpen.bind(this);
}
}
// Button click event function
buttonClick() {
// Open column chooser
this.grid.openColumnChooser();
}
// Column chooser’s open event function
columnChooserOpen(args) {
// Here you can change the column chooser element's position as per your requirement
} |
// Grid’s actionComplete event function
actionComplete(args) {
if (args.requestType === "filterafteropen" && args.columnType === "date") {
var dateObj = args.filterModel.dlgDiv.querySelector('.e-datepicker').ej2_instances[0];
dateObj.format = "d/M/y";
}
} |