rappasoft / laravel-boilerplate

The Laravel Boilerplate Project - https://laravel-boilerplate.com
https://rappasoft.com
5.59k stars 1.58k forks source link

Datatables or naw? #555

Closed rappasoft closed 7 years ago

rappasoft commented 7 years ago

I gotta be honest, I don't like datatables at all. It's cumbersome and has way more features than I think anyone with tabular data needs.

I found this, and I watched the video on how it was made, I think it would be a good drop in replacement: https://github.com/codekerala/data-viewer-laravel-vuejs

Especially because it is made with Vue 2.0 and would be an excellent learning tool in addition to having great search and filtering features that you can drop on any page and use any model with.

Want to hear peoples thoughts.

If not, I'm probably going to do it for myself in a custom version of the BP, instead of having support for both routes since that would be a pain in the butt.

poseso commented 7 years ago

it actually look really good, I don't like dataTables either, I only use it because it's already on the BP, if no one wants it, you can make a different branch for it and I will absolutely use it hehe 👍

blomdahldaniel commented 7 years ago

That sounds like a great Idea imo. Right now, so much stuff is hidden in DataTables and is a bit too abstract. And as soon as you mess something up in the backend, the DataTables is the first to alert an ajax error...

This would, like you said, be a good and easy way to help people get started with and add their own tables and functionality. But, it is a pretty big thing adding such a javascript framework. I love VueJS. But suddenly the repo gets opinionated about the choice of javascript framework. However compared to DataTables i think it would make sense just swapping them out. I don't think that should limit us, but we just need to be aware.

I do not like the way he did search though. Really bad UX in my opinion: "select field, select search operator and enter search keyword". In my opinion there should be a big LIKE % $1 %, looking in all the columns.

Otherwise I think it looks like a great solution that brings back the full control to this repo. It will be easy to understand/debug/extend and a good feeling to know the codebase.

Also glad to see him use axios since vue-resource has been kind of abandoned by Evan.

rappasoft commented 7 years ago

I'm not sure what Axios is and why it's better than vue-resource. But if vue-resource is deprecated why is it still included in a default 5.3 installation? https://github.com/laravel/laravel/blob/master/package.json#L16

Also, the only reason I don't mind putting Vue components in is that Laravel itself uses it by default and I don't see it going anywhere, also from what i've seen its much easier than the rest and is probably the better choice.

rappasoft commented 7 years ago

There's also alternatives:

https://www.dynatable.com/ http://fooplugins.github.io/FooTable/index.html https://github.com/Mobius1/Vanilla-DataTables

blomdahldaniel commented 7 years ago

Read Retiring vue-resource announcement by Evan. Vue Resource will remain but maintained by another organisation. He claims that axios might be a good alternative. He does not say that everyone should stop using vue-resource though.

@rappasoft : Also, the only reason I don't mind putting Vue components in is that Laravel itself uses it by default and I don't see it going anywhere, also from what i've seen its much easier than the rest and is probably the better choice.

I agree!

Regarding other alternatives for a table-solution Im not so sure. I dont think that other packages like that does it much better than DataTables..? It would be good to "blame" someone else if things break. On the other hand, the Vue example is so simple and not complex at all. I thingk that is a good way of bringing back the control of the table experience and functionality!

ghost commented 7 years ago

And I do not like DataTables. Especially if you look https://github.com/yajra/laravel-datatables/issues I use package for handling column sorting https://github.com/Kyslik/column-sortable and Searchable https://github.com/jarektkaczyk/eloquence I learn VueJS. Can VueJS ...

rappasoft commented 7 years ago

I like Vue, though I don't know a lot. I know if I replace datatables with that example there will just be a flood of issues and I won't know how to fix. So if everyone would be open to a simpler implementation of viewing data, and build on it by themselves, then it would be good.

The other problem is datatables lets you alter the columns after the data is fetched, and this does not and i'm not sure how.

blomdahldaniel commented 7 years ago

I think it would be good to step down from the complexity a bit so move away from datatables would be nice.

Yes, that is a problem though. The ability to format the data or output.. Hm.. I guess that the Vue-table logic could be a vue-mixin and then every new table has to have its own .vue file with a table template inside? So "UserTable.vue" can import the mixin with logic and then use the specific template to render buttons, formates and so on..? But on the other hand laravel can format it before maybe and then use the template to create specific things?

rappasoft commented 7 years ago

I'm not that versed with Vue yet so I have my limitations.

minedun6 commented 7 years ago

problem with this package, the first one you mentionned is that you can't use relationships.