All,
I'm trying to add a custom button to a grid and I'm having trouble getting the function/method to run. I've tried a few ways with different results (none successful). The grid is setup within KUIB.
Hello Louis,
I also see error "Error: transition superseded". My guess is that it is related to the button being a hyperlink. It should work though.
See www.telerik.com/.../custom-toolbar-button-with-angularjs
We should report the errors to technical support so that the issue can be investigated.
I also tried to use k-options but I got error again.
I found the following approach to work.
In your constructor (I am assuming a custom view), you can run the following code:
this.$components.grid0.options.toolbar.push({
name: "resequence",
template: "<button class='k-button' id='resequence'>Resequence</button>"
});
cancelWatch = $scope.$watch(function () {
var element = angular.element("#resequence");
if (element.html()) {
return element;
} else {
return undefined;
}
}, function (element, oldValue) {
if (element) {
element[0].onclick = function() { console.log("DEBUG:"); };
cancelWatch();
}
});
I hope this helps,
Edsel
Hello Louis,
I also see error "Error: transition superseded". My guess is that it is related to the button being a hyperlink. It should work though.
See www.telerik.com/.../custom-toolbar-button-with-angularjs
We should report the errors to technical support so that the issue can be investigated.
I also tried to use k-options but I got error again.
I found the following approach to work.
In your constructor (I am assuming a custom view), you can run the following code:
this.$components.grid0.options.toolbar.push({
name: "resequence",
template: "<button class='k-button' id='resequence'>Resequence</button>"
});
cancelWatch = $scope.$watch(function () {
var element = angular.element("#resequence");
if (element.html()) {
return element;
} else {
return undefined;
}
}, function (element, oldValue) {
if (element) {
element[0].onclick = function() { console.log("DEBUG:"); };
cancelWatch();
}
});
I hope this helps,
Edsel
Thanks Edsel, that works great.
Louis