I have been doing jqgrids in the last couple of days, and I have almost everything I want from the display, tabs with different grids, etc.
I want to use Modal to add and edit elements in my grid. My problem is that Im working on this. I have my editurl: "editsu.php" installed, if this file is renamed, when editing I get 404 in modal mode .. great! However, nothing happens with this file. I even put a stamp ("testing"); the line is at the top, so it sees the file, it just does nothing with it.
Below is the content. ........ index page
jQuery("#landings").jqGrid({
url:'server.php?tid=1',
datatype: "json",
colNames:['ID','Tower','Sector', 'Client', 'VLAN','IP','DLink','ULink','Service','Lines','Freq','Radio','Serial','Mac'],
colModel:[
{name:'id', index:'id', width : 50, align: 'center', sortable:true,editable:true,editoptions:{size:10}},
{name:'tower', index:'tower', width : 85, align: 'center', sortable:true,editable:false,editoptions:{readonly:true,size:30}},
{name:'sector', index:'sector', width : 50, align: 'center',sortable:true,editable:true,editoptions:{readonly:true,size:20}},
{name:'customer',index:'customer', width : 175, align: 'left', editable:true,editoptions:{readonly:true,size:35}},
{name:'vlan', index:'vlan', width : 35, align: 'left',editable:true,editoptions:{size:10}},
{name:'suip', index:'suip', width : 65, align: 'left',editable:true,editoptions:{size:20}},
{name:'datadl',index:'datadl', width:55, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from datatypes"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}},
{name:'dataul', index:'dataul', width : 55, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from datatypes"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}},
{name:'servicetype', index:'servicetype', width : 85, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from servicetype"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}},
{name:'voicelines', index:'voicelines', width : 35, align: 'center',editable:true,editoptions:{size:30}},
{name:'freqname', index:'freqname', width : 35, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from freqband"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}},
{name:'radioname', index:'radioname', width : 120, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from radiotype"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}},
{name:'serial', index:'serial', width : 100, align: 'right',editable:true,editoptions:{size:20}},
{name:'mac', index:'mac', width : 120, align: 'right',editable:true,editoptions:{size:20}}
],
rowNum:20,
rowList:[30,50,70],
pager: '#pagerl',
sortname: 'sid',
mtype: "GET",
viewrecords: true,
sortorder: "asc",
altRows: true,
caption:"Landings",
editurl:"editsu.php",
height:420
});
jQuery("#landings").jqGrid('navGrid','#pagerl',{edit:true,add:true,del:false,search:false},{height:400,reloadAfterSubmit:false},{height:400,reloadAfterSubmit:false},{reloadAfterSubmit:false},{});
now for editsu.php ..
$operation = $_REQUEST['oper'];
if ($operation == "edit") {
qquery("UPDATE customers SET vlan = '".$_POST['vlan']."', datadl = '".$_POST['datadl']."', dataul = '".$_POST['dataul']."', servicetype = '".$_POST['servicetype']."', voicelines = '".$_POST['voicelines']."', freqname = '".$_POST['freqname']."', radioname = '".$_POST['radioname']."', serial = '".$_POST['serial']."', mac = '".$_POST['mac']."' WHERE id = '".$_POST['id']."'") or die(mysql_error());
}
Itβs just hard for me to find this to find out where he was hanged.
, , , "", db , , , .
!