I needed this function to display the panel when at least one row was selected. I initially set the clock, but decided it was too expensive.
I ended up adding a callback inside the stSelectRow directive.
ng.module('smart-table') .directive('stSelectRow', function () { return { restrict: 'A', require: '^stTable', scope: { row: '=stSelectRow', callback: '&stSelected' // ADDED THIS }, link: function (scope, element, attr, ctrl) { var mode = attr.stSelectMode || 'single'; element.bind('click', function ($event) { scope.$apply(function () { ctrl.select(scope.row, mode, $event.shiftKey); scope.callback(); // AND THIS }); }); //***/// } }; });
Then I was able to pass the function from my controller to the directive (note: you could pass the selected line back, I didn’t need to)
tr ng-repeat="row in customerResultsTable" st-select-row="row" st-select-mode="multiple" st-selected="rowSelected()">
Reference to this post for reference . Callback function inside the attr directive defined in different attr parameters
source share