ekokotov / object-table

Angular directive to easy create dynamic tables from source or URL with sorting, filtering and pagination. Smart templates and good perfomance
BSD 3-Clause "New" or "Revised" License
171 stars 52 forks source link

How to get the custom sorting #30

Closed Parthvora closed 8 years ago

Parthvora commented 8 years ago

Hello,

In order to use custom sorting, I want to call an function using ngClick on each header tags of the table. But its just not working:

https://plnkr.co/edit/sTeX2Kj69S7vp5cZqrEX?p=preview

Keep open you browser console, click on that "Click me" button and you will see a message. But when I'm trying to call that same function on click on those table headers, its not working.

Any help would be appreciated. Thanks.

Parthvora commented 8 years ago

I found it - use $owner in HTML template like:

< th ng-click="$owner.customSort()" allow-drag>First name

instead of

< th ng-click="customSort()" allow-drag>First name

http://ekokotov.github.io/object-table/samples.html#/custom_rows_headers