i am using Jqgrid http://t开发者_如何学Gorirand.com/blog
its a very good grid solution, the linked one is the opensource version which lacks a php implementation.
so far i save input with a simple form to $PHP_SELF which refreshes the data. i would like to save the data with ajax but have no clue how to achieve.
unfortunately trirand.com does not provide us with php code for saving/submitting for the examples which can be found here:
http://www.trirand.com/blog/jqgrid/jqgrid.html
Please some advanced user provide some straight sample code for saving a row frameworkintern by editing through a modalbox without reloading the page.
Many thanks for your time Cheers, kilik
Since nobody is responding here or at trirand.com i answer myself for others who might face the same challenge:
set 'editurl' to your script and then get the field-names as $_POST. Jqgrid seems to populate your simple mysqlquery automatically into an ajax-request.
do this to analyze the $_POST array:
foreach ($_POST as $key=>$value){
$post .= $key.$value;
}
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $post);
fclose($fh);
my problem was that i saved a var_dump($_POST) as $post and wondered why there was no output other than "1". you need to write file cause an echo does not seem to reflect on the screen.
there might be other or better ways doing this.. its just my humble way since nobody seems to want to be of help on this popular grid-solution where the matching php framework can be purchased through a commercial subscription.
Jqgrid is somewhere between the heavy but versatile extjs and the lightweight slickgrid and fancygrid. All of them are open source (at least the js-files).
精彩评论