twar59 / ember-jquery-datatables

Wrap the jquery DataTables plugin in an ember-cli project
MIT License
4 stars 0 forks source link

No documentation? #1

Open MaazAli opened 10 years ago

MaazAli commented 10 years ago

I couldn't find any documentation to utilize this wrapper in my own ember-cli project.

twar59 commented 10 years ago

I was pretty much abandoning this project. I was having an issue getting the datatable to refresh properly. (becasue you created an issue) I will take another look today, and either get it working and document it, or create an issue for my blocker.

MaazAli commented 10 years ago

Good to hear that you'll be looking over it.

Ashok-N commented 10 years ago

Tom, Is datatable refresh issue resolved? Populating a datatable is a basic requirement in any application.But, unfortunately, there are no good examples available for integrating Ember with Jquery datatable. I am glad that you are working on the wrapper which can resolve datatable issues. Please update the documentation if the issue is resolved.

knshetty commented 9 years ago

By considering 'ohmygoshjosh' suggestion made in the official jQuery-DataTables discussion-forum => http://datatables.net/forums/discussion/19819/datatables-ember-data. I have implemented an emberjs-component that warps jQuery-DataTables & managed to get the datatable to work during all four CRUD operations on items that are listed & be re-rendered.

Well, I have stolen the 'Book Manager' concept presented in this project by 'twar59' and add a few more twists to make the demo interesting. Of-course the implementation is an ember-cli project with CoffeeScript. Well, here's the source code of my project => https://github.com/knshetty/emberjs-component-jquerydatatables-example. Online demo of the app can be found here => http://knshetty.github.io/emberjs-component-jquerydatatables-example/. If you guys have suggestion/s on improving the emberjs-component implementation, feel free to make a pull request.

To summarise, my approach of wrapping jQuery-DataTables as an emberjs-component, I did take these steps: i. I extracted the Ember-data model from the store within the main-route, so that all the goodness of Ember-data could be contained within the main-controller without worrying about jQuery-DataTables. In effect, isolating the direct jQuery-DataTables value dependency/binding with Ember-data model. ii. I replicated the above extracted Ember-data model into an array-list within the main-route implementation itself. Therefore, the resulting array-list is used for binding jQuery-DataTables's value and later in the main-controller to sync this array-list as-and-when the CRUD operations take place on the actually Ember-data model items. Take a look the below source-code for an insight into the main-route & main-controller respectively: