I'm trying to find a simple example of integrating jqGrid with the framework of AngularJS (preferably as a directive that hosts the grid). This question was raised in SO jqGrid with AngularJS, but it was not fully answered. I do not wish to use another 3rd party library at this point. I would like to see the best practice of integrating jqGrid with AngularJS with just the controller and mv* style approach.
There is also an Angular jqGrid cookbook by Wintellect https://github.com/Wintellect/Angular-MVC-Cookbook, but it uses the $route object which I'm not crazy about at this point. I'm not trying to build a SPA right now (perhaps later).
Can someone please point me to a simple example or something in JSFiddle? Thanks.
Disclaimers:
I've never heard of jqGrid before.
I don't have much jQuery experience.
From what I could tell its API isn't conducive to a 1-to-1 mapping of Angular's data-binding way of doing this vs. manual manipulation.
Here's what I came up with. It's a basic example of how to wrap this (or any probably) jQuery plugin with an Angular directive:
http://plnkr.co/edit/50dagqDV2hWE2UxG9Zjo?p=preview
Let me know if there's a particular part of the jqGrid API you need help wrapping.
Im currently working on a full replacement of jQgrid into Angular, im adapting backend response examples from jqGrid tables and such... it has only a few days of work so if you want to colaborate you are welcome to do so!: ngGrid
I cannot comment, so I post it here, it is the continuity of the question.. I'm also checking your github project luacassus, if I can, I will contribute to it. Nice feature, Words Like Jared. As you said, there is an other part of the API I would like to wrappe with Angular, it is the "pager", I managed it this way :
And this in the directive :
But I would like to get rid fo the ID, entered the hard way here. After that I will try to use the API like you in order to implement the cell/row/navbar editing possible. (To modify the scope data by modifying data inside the grid... if someone has already something...)