ratiw / vue-table

data table simplify! -- vuetable is a Vue.js component that will automatically request (JSON) data from the server and display them nicely in html table with swappable/extensible pagination component.
MIT License
1.83k stars 303 forks source link

sortField for custom component column #99

Open z1haze opened 8 years ago

z1haze commented 8 years ago

Im curious if there is a way to have a sortField for custom components? I have a column setup like so:

{
                        name: '__component:ip-column',
                        title: "last ip",
                        sortField: 'ip'
                    },

but i cant click/sort the column. Thanks!

ratiw commented 8 years ago

@z1haze It was done since v1.5.0.

z1haze commented 8 years ago

mind explaining it then? am i doing this incorrectly in my example? because it doesn't work. ... nice i updated to whatever 1.5.x and now it broke everything.. no errors just not displaying anything.

EDIT: I read the other tickets, updated vue-resource to 1.0.2 and im good to go.

ratiw commented 8 years ago

Don't know what to explain. The sortField will do what it will do. The field definition you've given is already correct and should work. If it's not, you need to look into your code.

I'm quite busy at the moment and will only able to answer simple question, anything more complex will have to wait to be inspect during the weekend.

I'm glad that you are able to find solution from other tickets, but I think the next thing you should do is learning from the source code. I think the code is very easy to understand and you will learn a lot more. I just hope that once you've learned, you would contribute back in term of PR for bug fixes, documentation, or feature suggestion. It would help me and the other a lot.