Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150331 | Jan 2,2020 10:20 AM UTC | Jan 7,2020 07:21 AM UTC | Angular - EJ 2 | 4 |
![]() |
Tags: Grid |
// 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";
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.