Hello:
I need to dynamically edit and change the server data.
http://pssnet.com/~devone/ajqtable/editgrid2.html
Right now, when the fields get edited php posts names instead of values to the db. My assumption is that on submit, the editurl will be called upon with the changed data. I read in the docs that I may have to add an onSubmit function (as shown below).
<?php
include("dbc.php");
$var1 = $_POST['service_id'];
$var2 = $_POST['name'];
// $var1 = "abc";
// $var2 = "xyz";
mysql_query("INSERT INTO
testwrite (service_id, name)
VALUES('$var1', '$var2') ")
or die(mysql_error());
?>
onclickSubmit : function(eparams)
{
var retarr = {};
// we can use all the grid methods here
//to obtain some data
var sr = jQuery("#grid_id").getGridParam('selrow');
rowdata = jQuery("#grid_id").getRowData(sr);
if(rowdata.somevalue=='aa') {
retarr = {myname:"myvalue"};
}
return retarr;
Thank you for you help.
Regards, Nat
From stackoverflow
-
I got it.....
I had it as editdata{name: 'name', etc}
editdata is a function to send additional data.....
So...thanks....if any of you look at it...
Regards, Nat
-
I like the jquery plugin editInPlace http://davehauenstein.com/code/jquery-edit-in-place/example/ http://code.google.com/p/jquery-in-place-editor/
0 comments:
Post a Comment