Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
navigrid passes wrong ID
20/07/2009
11:15
Avatar
wiliampsin
Member
Members
Forum Posts: 4
Member Since:
17/02/2009
sp_UserOfflineSmall Offline

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>

20/07/2009
11:42
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

20/07/2009
11:51
Avatar
wiliampsin
Member
Members
Forum Posts: 4
Member Since:
17/02/2009
sp_UserOfflineSmall Offline

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.
20/07/2009
12:45
Avatar
wiliampsin
Member
Members
Forum Posts: 4
Member Since:
17/02/2009
sp_UserOfflineSmall Offline

I figured this out, it was in my PHP code: 

 

    $responce->rows[$i]['id']=$row[link_id];  <--- i changed this line from ($responce->rows[$i]['link_id']=$row[link_id];)

    $responce->rows[$i]['cell']=array($row[link_id],$row[link_name],$row[link_url]);

    $i++;

}

20/07/2009
13:45
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information