Under Review
Last Updated: 28 May 2024 10:18 by ADMIN
Marcos
Created on: 23 May 2024 10:53
Category: Grid
Type: Bug Report
1
Button is status bar template cannot be referenced via jQuery.data() method

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:

Sample

In the sample code, when selecting a cell in the top grid, the "T" button should be enabled but the line

$("#TestButton").data("kendoButton")

returns undefined.

1 comment
ADMIN
Aleksandar
Posted on: 28 May 2024 10:18

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>
Here is an updated REPL, demonstrating the above.

Regards,
Aleksandar
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.