Confuse in how to post data for edit row in jqgrid
This is the first time I'm using jqgrid. I have confused in how to post all value from modal's edit row(pencil icon).
I'm so familiar with dataTable but not in this plugin. I need some server side script for this edit process. So, I can learn from it.
Could you give some tutorials or sample to开发者_高级运维 send this data?
thanks in advance.
jQuery("#list").jqGrid({
url:'dounfinish.php',
datatype: 'json',
mtype: 'POST',
colNames:['id','Date', 'Line','Shift','Model','Serial','DIC','Def_class','Symptom','Cause','Symgrup','Modgrup'],
colModel :[......],
pager: jQuery('#pager'),
rowNum:10,
rowList:[10,20,30],
sortname: 'Problem_date',
sortorder: "desc",
editurl: "process1.php",
viewrecords: true,
imgpath: 'themes/basic/images',
caption: 'OQC DEFECT DATA'
});
jQuery("#list").jqGrid('navGrid','#pager',{edit:true,add:false,del:false});
how to send data to this:
........
case 'edit':
edit(postVar('id'),postVar('DIC'),postVar('Def_class'),postVar('Symptom'),postVar('Cause'));
break;
});
function edit($id,$DIC,$Def_class,$Symptom,$Cause){
$defID = mysql_real_escape_string($id);
$DIC = mysql_real_escape_string($DIC);
$Defclass = mysql_real_escape_string($Def_class);
$Symp = mysql_real_escape_string($Symptom);
$Cause = mysql_real_escape_string($Cause);
$DIC=strtoupper($DIC);
$Defclass=strtoupper($Defclass);
$sql = "UPDATE oqc_defect SET DIC = '".$DIC."', Def_class = '".$Defclass."', ";
$sql.= "Symptom = '".$Symp."', Cause = '".$Cause."' ";
$sql.= "WHERE def_id = ".$defID;
echo $sql;
$result=mysql_query($sql) or die(_ERROR26.": ".mysql_error());
//echo $result;
mysql_close($dbc);
}
just add loadonce : true
all can work normally.
精彩评论