I have a grid with a column checkbox.I want to be able to select all checkboxes, from outside the grid, when I click another checkbox. I try this but it doesn't seems to work.
Thank you in advance!
|
onClick() {
this.gridObj.selectionModule.checkSelectAll()
} |
Hello,
Thank you for your answer, but still doesn't work with checkbox.(
)
Works only with button.(
)
And my requirements are whith a checkbox, as I said before.
Thank you!
This solution works just fine!
Hello,
One more thing...:)
If the SelectAll checkbox is checked (the one that's outside of the grid) , and after that one of the row in the grid is unchecked, I want the SelectAll checkbox to be in the "indeterminate" state, like the one in the grid header.
Now it remain checked.
Thank you!
|
// Grid’s rowSelected event handler
rowSelected(args) {
this.updateExternalCheckState();
}
// Grid’s rowDeselected event handler
rowDeselected(args) {
this.updateExternalCheckState();
}
// Function for handling external header state
updateExternalCheckState() {
if (this.gridObj.getSelectedRecords().length === this.gridObj.dataSource.length) {
// Condition executes when all the records are selected
this.checkObj.checked = true;
} else if (this.gridObj.getSelectedRecords().length === 0) {
// Condition executes when all the records are un-selected
this.checkObj.checked = false;
} else {
// Condition executes when one or more records are selected
this.checkObj.indeterminate = true;
}
} |
Hello,
I have a problem with "lenght" property.
What can I do?
|
updateExternalCheckState() {
if (
this.gridObj.getSelectedRecords().length ===
(this.gridObj.dataSource as Object[]).length
) {
this.checkObj.checked = true;
} else if (this.gridObj.getSelectedRecords().length === 0) {
this.checkObj.checked = false;
} else {
this.checkObj.indeterminate = true;
}
}
|
Thank you!
Exactly what I needed!