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

Binding click event on a button in footer template

1 Answer 355 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Francis
Top achievements
Rank 1
Francis asked on 15 Aug 2017, 04:14 PM

Hi,

I'm currenty using MVVM across all my UI and it's working great but I have one small issue with a button inside a footer template which doesn't call the function inside my view model.

I include in attachment an example showing my issue.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 17 Aug 2017, 12:55 PM
Hello Francis,

On the following Dojo example you can find a modified version of the provided example, where the click binding in the footer template of the DropDownList widget works correctly.

To achieve the desired result, I have used the DropDownList's open event to bind the model to the footer template, which is outside of the binding container:
onOpen: function(e) {
  var footer = $(e.sender.popup.element).find(".k-footer")
             
  kendo.bind(footer, viewModel);
}

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Ishtiyaque
Top achievements
Rank 1
commented on 21 Mar 2022, 11:08 AM

Hello Dimitar,

I Have the same query.

Still the solution you provided doesn't work . And the Dojo link example is not working.

Neli
Telerik team
commented on 23 Mar 2022, 07:41 AM

Hi Ishtiyaque,

I tested the Dojo example provided by my colleague Dimitar and it is working as expected on my side. When the 'Add' button in the DropDownList footer is clicked and an alert appears. The example uses an old version - 2017.2.621. For the same example to works as expected with the latest version the selector for the footer element needs to be changed as demonstrated below:

 var footer = $(e.sender.popup.element).find(".k-list-footer")
Here you will find the modified Dojo

I hope this helps,

Neli

Tags
DropDownList
Asked by
Francis
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or