Forum


11:15

17/02/2009

I am having problems with my delete function because the navigrid is passing the wrong ID. It is passing the ID number in regards to the way they are listed out instead of the actual ID of the ID pulled from that database. Here is the code I'm using:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#list2").jqGrid({
url:'wrestling_links.php?nd='+new Date().getTime(),
datatype: 'json',
colNames:['Link ID','Link Name','Link URL'],
colModel:[
{name:'id',index:'link_id', width:55, editable:true, editrule:{readonly:true}},
{name:'link_name',index:'link_name', width:200, editable:true,editoptions:{size:25},editrules:{required:true}},
{name:'link_url',index:'link_url', width:425, editable:true,editoptions:{size:25},editrules:{required:true}}
],
pager: jQuery('#pager2'),
rowNum:10,
rowList:[10,20,30],
imgpath: 'themes/basic/images',
sortname: 'link_id',
viewrecords: true,
sortorder: "desc",
caption: "Links!"
}).navGrid('#pager2',
{add:true, edit:true,view:true, del:true, search:false}, //options
{height:150,width: 400,url:'editdb.php?method=update',reloadAfterSubmit:false,closeAfterEdit:true}, // edit options
{height:150,width: 400,url:'editdb.php?method=add',reloadAfterSubmit:true,closeAfterAdd:true},
{height:100,width: 200,url:'editdb.php?method=delete',reloadAfterSubmit:true,closeAfterAdd:true},
{} // search options
);
});
</script>
11:42

Moderators
30/10/2007

Hello,
Could you please put a simple response from the server - I mean the json reasponse. You can do this easy when you use FireBug.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
11:51

17/02/2009

Here is the json:
{"page":"1","total":2,"records":"11","rows":[{"link_id":"15","cell":["15","test","test"]},{"link_id"
:"11","cell":["11","Tiger Classic","http:\\/\\/www.aidupontwrestling.com\\/"]},{"link_id":"10","cell":["10"
,"Christiansburg Big Blue Tournament","http:\\/\\/www.bluedemonwrestling.com\\/big%20blue.htm"]},{"link_id"
:"9","cell":["9","Christiansburg Big Blue ","http:\\/\\/www.bluedemonwrestling.com\\/big%20blue.htm"]},
{"link_id":"8","cell":["8","Coach Welch in Nat. Finals","http:\\/\\/www.thewrestlingtalk.com\\/wrestling-videos
\\/id-0zTDjCoQcig.html"]},{"link_id":"7","cell":["7","Flo Wrestling","http:\\/\\/www.flowrestling.com\\/"
]},{"link_id":"6","cell":["6","Smyrna Wrestling","http:\\/\\/www.smyrnawrestling.com\\/"]},{"link_id":"5"
,"cell":["5","DE Preps","http:\\/\\/www.depreps.com\\/"]},{"link_id":"4","cell":["4","Beast of East","http
:\\/\\/www.beastwrestling.com\\/"]},{"link_id":"3","cell":["3","Bear Brawlers","http:\\/\\/www.eteamz.com
\\/bearbrawlers\\/"]}]}
Here is what is being sent to the editdb.php?method=delete page:
oper=del&id=1
In this case the ID should be 15.
13:45

Moderators
30/10/2007

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
105 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