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..
session_start();
if($_SESSION['loggedin'] != TRUE)
{
header(“Location: index.php”);
}
?>
body { background-color: grey; }
#main-wrapper { margin-left: auto; margin-right: auto; width: 1238px; border-left: 1px solid black; border-right: 1px solid black; }
$(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",{});
});
$("#button-logout").click(function() {
$.ajax({
type: "POST",
url: "php.scripts/logout.php",
data: {}
}).done(function( msg ) {
//alert( "Data Saved: " + msg );
window.location = "index.php";
});
});
[/CODE]
[CODE]
session_start();
if($_SESSION['loggedin'] != TRUE)
{
header(“Location: index.php”);
}
?>
body { background-color: grey; }
#main-wrapper { margin-left: auto; margin-right: auto; width: 1238px; border-left: 1px solid black; border-right: 1px solid black; }
$(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",{});
});
$("#button-logout").click(function() {
$.ajax({
type: "POST",
url: "php.scripts/logout.php",
data: {}
}).done(function( msg ) {
//alert( "Data Saved: " + msg );
window.location = "index.php";
});
});
[/CODE]
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top