Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
New/Edit/Del in The Demo Possible?
27/05/2010
17:44
Avatar
Omegatcu
New Member
Members
Forum Posts: 1
Member Since:
27/05/2010
sp_UserOfflineSmall Offline

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 🙂

27/05/2010
20:13
Avatar
ddotsenko
Member
Members
Forum Posts: 15
Member Since:
08/03/2010
sp_UserOfflineSmall Offline

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.

29/05/2010
23:36
Avatar
yarkot
Member
Members
Forum Posts: 3
Member Since:
29/05/2010
sp_UserOfflineSmall Offline

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

30/05/2010
00:15
Avatar
tim
Calgary Alberta Canada
Member
Members
Forum Posts: 61
Member Since:
04/11/2009
sp_UserOfflineSmall Offline

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.

31/05/2010
02:59
Avatar
yarkot
Member
Members
Forum Posts: 3
Member Since:
29/05/2010
sp_UserOfflineSmall Offline

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

31/05/2010
03:00
Avatar
yarkot
Member
Members
Forum Posts: 3
Member Since:
29/05/2010
sp_UserOfflineSmall Offline

I didn't say this:   submit button from the navigator does not seem to call the editurl  URL;   what setup for that to happen must I do (besides setting editurl)?

Thanks,

Yarko

31/05/2010
04:00
Avatar
tim
Calgary Alberta Canada
Member
Members
Forum Posts: 61
Member Since:
04/11/2009
sp_UserOfflineSmall Offline

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 ]

31/05/2010
15:37
Avatar
tim
Calgary Alberta Canada
Member
Members
Forum Posts: 61
Member Since:
04/11/2009
sp_UserOfflineSmall Offline

opps - my example link had an error later last night, when I pushed some code out. fixed.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information