Forum


05:14

20/09/2009

hi all!
I am new in jqgrid and i need some help 🙂
I have a datagrid to add,delete and edit customers.
I am using the mavigation buttons for these works.
My javascript code is the following :
jQuery(document).ready(function () {
jQuery("#listcust").jqGrid ( {
url:'xml/customers_xml.php',
datatype: "xml",
mtype: 'GET',
colNames:['ΚΔΩ.','ΟΝΟΜΑΤΕΠΩΝΥΜΟ','ΤΗΛΕΦΩΝΟ','E-MAIL','ΔΙΕΥΘΥΝΣΗ','ΣΗΜΕΙΩΣΕΙΣ'],
colModel :[
{name:'custid', index:'custid', width:90, editable:true,editoptions:{size:25}},
{name:'custname', index:'custname', width:90, editable:true,editoptions:{size:25}},
{name:'custphone', index:'custphone', width:90, editable:true,editoptions:{size:25}},
{name:'custmail', index:'custmail', width:90, editable:true,editoptions:{size:25}},
{name:'custaddress', index:'custaddress', width:90, editable:true,editoptions:{size:25}},
{name:'custnotes', index:'custnotes', width:190, editable:true,editoptions:{size:25}}
],
pager: jQuery('#pager1'),
rowNum:20,
rowList:[10,20,30],
sortname: 'custid',
sortorder: 'desc',
viewrecords: true,
autowidth: true,
height: 440,
loadtext: "ΦÏŒρτωμα ΔεδομÎνων...",
editurl:"xml/edit_customers_xml.php",
addurl:"xml/add_customers_xml.php",
caption: 'ΛΙΣΤΑ ΠΕΛΑΤΩΝ'
})
.navGrid('#pager1',{view:true, del:true, clearAfterAdd:true, search: true,add:true,closeAfterEdit:true},
{height:280,reloadAfterSubmit:true},
{height:280,reloadAfterSubmit:true},
{height:280,reloadAfterSubmit:false}, // delete instead that del:false we need this
{multipleSearch : true}, // enable the advanced searching
{closeOnEscape:true} /* allow the view dialog to be closed when user press ESC key*/
);
// $("#bedata").click(function(){
// var gr = jQuery("#listcust").getGridParam('selrow');
// if( gr != null ) jQuery("#listcust").editGridRow(gr,{height:280,reloadAfterSubmit:false});
// else alert("ΠαρακαλÏŽ επιλÎξτε κάποια εγγραφή πρÏŽτα");
// });
});
</script>
My edit page has the following code:
include ("../includes/db.php");
if ($_POST[custid]=="") {
//insert new row sql code
}
else {
//edit row sql code
}
?>
So if the custid is empty i call the add new row mysql code . id the custid has a valid id i call the edit mysql code. My question is how i inspect the delete ? what may i GET or POST for delete?
Sorry for my bad english
Most Users Ever Online: 715
Currently Online:
165 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66