Hello,
I have a button (id = deleteButton) declared in a template as shown in code below. It doesn't invoke the function deleteProduct on click event.
Thanks for your time and help.
I have a button (id = deleteButton) declared in a template as shown in code below. It doesn't invoke the function deleteProduct on click event.
Thanks for your time and help.
<
script
id
=
"template"
type
=
"text/x-kendo-template"
>
<
ul
id
=
"invitationsPanelBar"
>
# for (var i = 0; i <
data.length
; i++) { #
<li
id
=
"1"
>#= data[i].userName #<
button
style
=
"position:absolute;right:30px; type="
button"
id
=
"deleteButton"
data-bind
=
"click: deleteProduct"
><
span
class
=
"k-icon k-i-close"
></
span
></
button
>
<
ul
>
# for (var j = 0; j <
data
[i].invitationsList.length; j++) { #
<li><
span
>
<
a
href
=
"resultsContainer.html"
>#= data[i].invitationsList[j].userStarName #</
a
>
#if (data[i].invitationsList[j].status === "New") {#
<
span
style
=
"position:absolute;right:30px;color:\#85b2cb;"
>New</
span
>
#}#
</
span
>
</
li
>
#}#
</
ul
>
</
li
>
# } #
</
ul
>
</
script
>
$(document).ready(function() {
var viewModel = kendo.observable({
deleteProduct: function(e) {
console.log("deleteProduct");
var pbar = $("#invitationsPanelBar").data("kendoPanelBar");
pbar.remove($(e.currentTarget).closest("li"));
// pbar.remove("#1")
}
});
kendo.bind($("#deleteButton"), viewModel);
}