Forum


17:44

27/05/2010

Hey everybody 😉
i'm a little bit desperate - i have a Grid (my first) and on Server Side a PHP Script.
i Want to Create, Edit and Delete Database entrys in the grid and i know i must write the SQL for it....
what i don't know is how i can decide if it is an edit or an delete and how i get the data id for the data-set.
I searched the tutorial and the wiki in found no php code that edit or create new items an php side...!
Thank you for help 🙂
20:13

08/03/2010

It's got to be in the docs somewhere, but here is the short version:
Ajax calls going out to the server specify, as part of post arguments, what call it is - Edit, or Del.
Now, If id element in Edit post is empty or some unrecognizable garbage, it's an Add. :
Something like that.
Don't know if this will give you much of an example, but here, in testing.js I play around with Add, Edit, Del ajax calls and explain some thing in the comments: http://www.accentsolution.com/.....store.html
Until a proper answer comes around, this should keep you warm.
Daniel.
23:36

29/05/2010

Daniel -
What am I missing: I don't see where the setup for ajax calls is in your link.
I can generate a page from a database; I am trying to get navigator edits, and I don't "get" what you need to do to call back to the server on submit from the navigator.
There must be something really easy I'm missing, seeing (and yes, I'm completely a newbie to js / jquery, but not to programming).
Can anyone provide hints / example of how to setup navigator ajax call to send data to a server on onclickSubmit (or whatever the right incantation is)?
Thanks,
Yarko
00:15

04/11/2009

On the demo page:
http://trirand.com/blog/jqgrid.....qgrid.html
1. then go: Live Data Manipulation -> Navigator
2. Hit the '+' button (on the navbar).
3. Enter a client, then hit 'submit'
A post will be made to the server.
4. You need to handle the 'oper' argument, and since it is 'add' you will need to create/run your SQL that adds an item to your db.
I don't use PHP, but I believe you do: $oper = $_GET['oper'];
You can see the delete button works there too, the 'oper' = 'del'.
There is an additional arg 'id' when you do the delete.
02:59

29/05/2010

Hi Tim -
Thanks for the attempt; my problem is not at that level. I see that page, I read it's instructions, I build my app to generate the same (that's fine - I have data from my database, I can bring up a navigator form) I have a breakpoint set at my function (python, but that's not important), .... it never seems to get called even; so there is something more than setting "editurl"; I have the ajax call working to load the grid with data from the database (I do not pass the data "statically"), so..... I'm stumped at this point.
Need to see some full example code, with some useful comments so I can try to make sense of it, see what on earth I might be missing.
Regards,
Yarko
04:00

04/11/2009

It's better if you post your grid config file. Its' too difficult to suggest anything when I can't see the code.
tim
[edit: here's an example I have that works : http://blackstag.com/jqDemo/demo.jqGrid.PAGE0.html ]
Most Users Ever Online: 715
Currently Online:
67 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66