Forum
03:37
06/02/2013
Does anyone know how I am supposed to get the current rows data to my editurl PHP script? The grid is set up for inline editing. My navigator has both the regular form edit, inline edit and save disk button. I would like a way to tap into the save disk button as well..
[CODE]
<?php
session_start();
if($_SESSION['loggedin'] != TRUE)
{
header("Location: index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
body { background-color: grey; }
#main-wrapper { margin-left: auto; margin-right: auto; width: 1238px; border-left: 1px solid black; border-right: 1px solid black; }
</style>
<link rel="stylesheet" type="text/css" media="screen" href="jqueryui/css/smoothness/jquery-ui-1.9.2.custom.min.css" />
<link rel="stylesheet" type="text/css" media="screen" href="jqgrid/css/ui.jqgrid.css" />
<script src="jquery/jquery.min.js" type="text/javascript"></script>
<script src="jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
var lastSel;
jQuery("#grid-customers").jqGrid({
url:'php.scripts/get.customers.php',
datatype: 'xml',
mtype: 'POST',
colNames:['idcustomers','firstname', 'lastname','address1','address2','city','state','zip','phone','email','cell'],
colModel :[
{name:'idcustomers', index:'idcustomers', width:55, editable: true},
{name:'firstname', index:'firstname', width:90, editable: true},
{name:'lastname', index:'lastname', width:90, editable: true},
{name:'address1', index:'address1', width:90, editable: true},
{name:'address2', index:'address2', width:90, editable: true},
{name:'city', index:'city', width:90, editable: true},
{name:'state', index:'state', width:90, editable: true},
{name:'zip', index:'zip', width:90, editable: true},
{name:'phone', index:'phone', width:90, editable: true},
{name:'email', index:'email', width:90, editable: true},
{name:'cell', index:'cell', width:90, editable: true}
],
pager: '#grid-customers-pager',
rowNum:10,
rowList:[10,20,30],
sortname: 'idcustomers',
sortorder: 'desc',
viewrecords: true,
gridview: true,
caption: 'Customers',
height: 375,
onSelectRow: function(id){
if(id && id!==lastSel){
jQuery(this).restoreRow(lastSel);
lastSel=id;
alert(id);
}
//jQuery(this).editRow(id, true);
},
editurl: 'php.scripts/update.row.php',
saveRow: function(rowid) {
alert("Alert Sepy!");
}
}).navGrid('#grid-customers-pager',{}, {}, {}, {}, {}, {}).inlineNav("#grid-customers-pager",{});
});
</script>
</head>
<body>
<div id="main-wrapper">
<input id="button-logout" type="button" style="margin-left: 1170px;" value="logout">
<div style="margin: 0px; padding: 0px; margin-left: auto; margin-right: auto; width: 1200px;">
<table id="grid-customers"><tr><td/></tr></table>
<div id="grid-customers-pager"></div>
<br>
</div>
</div>
<script type="text/javascript">
$("#button-logout").click(function() {
$.ajax({
type: "POST",
url: "php.scripts/logout.php",
data: {}
}).done(function( msg ) {
//alert( "Data Saved: " + msg );
window.location = "index.php";
});
});
</script>
</body>
</html>
[/CODE]
Most Users Ever Online: 715
Currently Online:
47 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