Solved

dynamic table creation

Posted on 2011-03-07
2
357 Views
Last Modified: 2012-05-11
Hi

Im trying to create a form and a data grid, which submitted data add to row and then call ajax function and save record to database

i need to add edit delete button to the row and also need to get id of the record to call specific row update , delete

problem is what is the best way to get record id when adding row to the table?


Regards



0
Comment
Question by:3xtr3m3d
2 Comments
 
LVL 15

Accepted Solution

by:
SRigney earned 500 total points
ID: 35059348
I think jQgrid will give you everything that you need for working with a table dynamically. http://trirand.com/blog/jqgrid/jqgrid.html

When I do similar things I have my Ajax call return the id that was added to the database and I update that row with the id.   I use a negative number to hold it's place. I start at -1 and count backwards for each one that I use to keep the row uniquely identified.
0
 
LVL 3

Author Comment

by:3xtr3m3d
ID: 35059760
Thanks for the information. im gona build a system for a book store and seems jqgrid can handle most its functions.

i also did that by generating unique id and save with that id so newly created button knows the id and can call query with that id.


Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question