openpsa / jsgrid

Fork of last jqGrid version before license change
http://openpsa.github.io/jsgrid/
Other
28 stars 12 forks source link

Adding Grouping demos and renaming existing demo 'local' as that makes more sense #17

Closed meh-uk closed 9 years ago

meh-uk commented 9 years ago

Updating the grouping demos so they use markdown and giving them each individual pages.

flack commented 9 years ago

Thanks! I'll pull that locally and adjust the build system so that it can things like your grouping.json file (although I seem to remember that at least some browsers don't support AJAX requests when run from file system, so it could be that the demos then only work over HTTP).

flack commented 9 years ago

I have merged this locally now and deployed to the docs site:

http://openpsa.github.io/grid.js/demos/groupingDisplay.html

(demos section is still missing a right-hand navigation unfortunately, I'll look into that soon)

I've made a few minor changes in order to get the demos to work with the way this is implemented right now:

https://github.com/openpsa/grid.js/commit/fed4fe5be4f07cb008601ca62a868a4b931ecdb1

BTW, personally I find that the demos would be easier to understand if they used local data. Because right now when you look at the grouping demos, you see the options that are set and that they reference some columns, and you see the rendered grid with some dummy values, but you can't easily tell where they are coming from and thus how it all fits together.

meh-uk commented 9 years ago

Yeah, that's a fair point about it not being clear, however people are generally going to use server side data in the real world :(.

Can we use JSON data and also make it viewable somehow?

flack commented 9 years ago

well, with enough time and energy, you can implement almost anything :-)

The only drawback I see is that if we're adding some custom handlebar functions to do this is that then the markdown file itself will get less readable, i.e. when you view it in a text editor (or on github). What we could do though is implement this in Javascript and run it on the client side. Bascially intercept the ajax response and print it on screen somewhere.

flack commented 9 years ago

The code that renders the grid on screen is here:

https://github.com/openpsa/grid.js/blob/master/docs/template/ui.js#L10

It's not very pretty, I know. An implementation idea for intercepting the http response would be to splice some ajaxGridOptions handler into the text read from the codetag. It's a bit of a hack of course, so if you know a cleaner way to do this go right ahead :-)