Define ng-click on rows
Have been looking for a decent grid for a while now and wasn't happy at all with ng-grid, ng-table, wijmo or kendo... this looks SUPER promising.
I'm trying to convert an ng-table directive that contained an ng-click="open(myItems.id)" directive on
Any ideas, or is this possible as an enhancement?
Thanks for the great work to date, it seems like you've made some serious progress in the last few months!
I do something similar, but instead of routing to a new page, I just display the details below. I'll post what I use below. This is probably not the best way to do it, but it should work.
<table items="offices" tr-ng-grid="" selected-items="officeDetails"
selection-mode="SingleRow"></table>
$scope.$watch('officeDetails[0]', function (value) {
$scope.offDetail = _.find($scope.offices, function (office) {
return office.officeId === value.officeId
})
});
Yep, that is the way to go:
- Monitor the collection you attach to
selected-items. - Alternatively, if you don't need more data, you could directly couple the first item in the selection collection directly to a div having a
ng-iforng-showdirective.
The grid uses dual data binding for most of its features which makes it convenient to attach extra logic, the Angular way.