I'm using the jqgrid plugin for jquery and jquery ui and I would like to change the AJAX url on a dom event. this is the instatiation of the jqgrid table:
jQuery("#list").jqGrid({
url:'AJAX/JSON/json_member_mail.aspx',
datatype: 'json',
mtype: 'GET',
colNames:['','Title', 'from','message',''],
colModel :[
{name:'checkbox', index:'pms.pm_id', width:15, gridstate:'hidden',sortable:false} ,
{name:'title', index:'pmthreads.pmthread_subject', width:140},
{name:'from', index:'pms.pm_authoruser_id', width:110, align:'center',classes:'mofo_id' } ,
{name:'message', index:'message', width:445, sort开发者_开发知识库able:false},
{name:'tasks', index:'tasks', sortable:false, width:65, align:'right'}
],
pager: '#pager',
rowNum:20,
rowList:[10,20,30],
width: '100%',
height: '800',
sortable:true,
sortname: 'someting that makes sense to the cragted mysql query ',
sortorder: 'desc',
viewrecords: true,
caption: 'Mail'
});
now this page shows the user mail inbox in my program... now I would like to change the url to member_mail_sent to show the outbox but then I would also need to change colName and colModel, sortname etc...
I remember seeing something that made this alot easier in the documentation but now I can't find it anywhere.
found it, yeap victor is right though I didn't check back early enough to get your hint but I did it with setGridParam...
jQuery("#list").jqGrid('setGridParam',{url:"AJAX/JSON/json_member_mail_sent.aspx?message_mask="+message_mask,page:1}).trigger("reloadGrid");
You would use the setGridParam
method to change the url
option.
精彩评论