I'm using the grid with a Status Bar Template and a button component in the template.
When trying to reference the button using the data() method it returns "undefined".
I've made small changed to the Grid's "selection Aggregates" demo to show the problem:
In the sample code, when selecting a cell in the top grid, the "T" button should be enabled but the line
returns undefined.
Hi Marcos,
The StatusBarTemplate is refreshed each time a selection is made. The Change event, however, fires before the re-rendering of the StatusBarTemplate has completed, thus the component in the template is not yet initialized. I can suggest the following update in the Change event logic, so the handler logic is executed after the rendering has completed:
<script>
function onTest(e) {
queueMicrotask(() => {
let testButton = $("#TestButton").data("kendoButton");
testButton.enable(true);
});
}
</script>
Regards,
Aleksandar
Progress Telerik