data-bind events is not working now in latest version

0 Answers 9 Views
Grid
Rwesssc
Top achievements
Rank 1
Rwesssc asked on 16 Feb 2022, 09:35 AM
<script type="x-kendo/template" id="template">
    <button data-role="button"
            data-icon="add"
            data-bind="events: { click: onClickAddProject }"
            style="width: 180px">
        Click me
    </button>
</script>
<script>
    var vm = kendo.observable({
        baseURL: `projects`,
        onClickAddProject: function () {
            console.log("OK")
            alert("OK")
        }
    });
    kendo.bind($("#view"), vm);
</script>
Rwesssc
Top achievements
Rank 1
commented on 16 Feb 2022, 11:53 PM

$('#projectGrid').kendoGrid({
        dataSource: new kendo.data.DataSource({
            transport: {
                read: {
                    url: `${vm.baseURL}/list`,
                    dataType: "json",
                },
            },
            // pageSize: window.uiDefaults.pageSize,
            // group: {
            //     field: "fieldName",
            // },
            batch: true,
            schema: {
                model: {
                    id: "project_id",
                    // fields: {
                    //     field_name: {
                    //         editable: false,
                    //         nullable: false
                    //     },
                    // }
                }
            }
        }),
        toolbar: kendo.template($("#template").html()),
        columns: [{
                field: "project_id",
                hidden: true,
                groupHeaderTemplate: "#= value #",
            }, {
                field: "project_name",
                title: "Project Name"
            }, {
                field: "project_quire_link",
                title: "Quire Link",
                template: (data) => {
                    return `<a href="${data.project_quire_link}" target="_blank">${data.project_quire_link}</a>`
                }
            }
        ],
    });
Georgi Denchev
Telerik team
commented on 21 Feb 2022, 08:23 AM

Hi, Rwesssc,

I tested the events binding in the following Dojo with the latest version, however I can't seem to be able to reproduce the issue. The binding is working as expected.

Let me know in case you notice something incorrect with the example.

Best Regards,

Georgi

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Rwesssc
Top achievements
Rank 1
Share this question
or