Reputation: 2070
I realise this is something of an abuse of jqGrid, but I have already got one set up that I use on an admin page that lists a bunch of entries and allows admins to CRUD them.
Now I need a CrUd form for users to work on their individual record. They don't need a grid - just need to have the form pop up to add their initial record, or edit it. It's heart breaking that the code to generate the form is there on another page and works a treat, just it's got the whole grid being shown which will totally ruin the page for them.
More generally - being able to spin up a form based on a colModel, and have it kick of the json requests - that's cracking stuff that I could do without recoding myself everytime!
I assume the form portion of jqGrid COULD be an independent piece of code that simply shares a common form of colModel to the grid part.
thoughts - suggestions?
Upvotes: 1
Views: 393
Reputation: 27943
You can move grid out of browser screen by using
jQuery.extend(jQuery.jgrid.edit, {
height: 1,
width: 1,
top:-100,
left: -100
} );
after grid is created, call its edit or add method to show form:
$("#add_grid_top").click()
Upvotes: 1