This is a migrated thread and some comments may be shown as answers.

Rebinding kendo dropdown event

1 Answer 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 25 Feb 2016, 11:48 PM

Hi All,

I have a page which call a partial view page and all the command buttons lost their click event once returned.  I called a function from the dataBound of the grid to rebind the click event for the buttons and it works, but how do I rebind for a template dropdown?

...

dataBound: function(e) {
                rebindGridObjects();
            },

columns:[{

                   field: 'ReportList.Description',
                    title: 'In Reports',
                    width: 135,
                    template: "#=reportTemplate(ReportList,Report.Description)#",
                    editor: function invoiceReportsDropDown(container, options) {
                        if (options.model.ReportList.length <= 1)
                            return;
                            $('<input data-text-field="Description" class="reportListItems" data-value-field="Id" data-bind="value:' + options.field + '"/>')
                                    .appendTo(container)
                                    .kendoDropDownList({
                                        dataSource: options.model.ReportList,
                                        dataTextField: "Description",
                                        dataValueField: "Id",
                                        change: function (e) {
                                            selectedReport = e.sender.value();
                                            ......
                                               
                                            }
                                        }
                                    });
                    },

 {
                    command: [
                        {
                            name: "test",
                            text: "test",
                            click: testLogic
                        }
                    ],                    
                    title: "",
                    width: 90
                },

 function rebindGridObjects(e) {        
        $("#igrid .k-grid-content").find(".k-grid-test").bind("click", function(e) { testLogic($(this)); });    //work with command button

}

 

function reportTemplate(){

..getting the report

}

 

TIA

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 01 Mar 2016, 06:42 AM

Hello Steve,

 

We are not sure about the scenario you have. How does the returned partial view interfere with Grid buttons? Can you illustrate the scenario in a isolated runnable example? This will helps us understand it assist you further.

 

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or