0
votes

I am trying to use class directive to attach click event to the next page button on the kendo grid.

Directive:

.directive('kPagerNav', function () { 
           return {
            restrict: 'C',                   
            controller: function ($scope, $element, $attrs, $location) {

                if (typeof $scope.testFunc === "function") {
                    $element.click(function () {
                        $scope.testFunc();
                    });
                }
            }
        }
        })

Example http://dojo.telerik.com/AKiqO

I have exactly the same directive working for a 'cancel changes' button , but I can't get next page click working.

1
Can't really tell from only this code. But the most common source of problems like this are because you are using a normal jquery click registration instead of ng-click. you need to call $scope.$apply() at some point. perhaps after testFunc is calledjw56578
Is demo link not working for you ?witpo
It is, sorry i'm not familiar enough with kendo UIjw56578

1 Answers

0
votes

I think that the directives do not work because the pager is updated asynchronously, and the arrows do not match the directive CSS class at compilation time.