Linking within jqGrid
Suppose we have 2 separate jqGrid pages. On one side we have an overview about artists, on the other an overview about their works. I done linking with context menu. For example, from artist there is a link to their works. The link is as follows
$(window.location).attr('href', $(window.location).attr('href').replace('c_picture','c_edition')+'?_search=true&rows=10&page=1&searchField=work_id&searchOper=eq&searchString='+jQuery("#grid").getCell(e.id, 'work_id');
Is it a reasonable solution to the problem?
PS. I am not looking for ajax load, I try to make a link to another page (to another grid). I changed my call now to window.locati开发者_开发问答on.href = window.location.href.replace('c_picture','c_edition')+'/?_search=true&rows=10&page=1&searchField=work_id&searchOper=eq&searchString='+jQuery('#grid').getCell(e.id, 'work_id');
But this method seems still to be very "dirty". For example with window.location.href I can not change parameter _search
. Is it better to make small form with all GET-Parameters and then submit this?
I link two grids together on a single page (not sure if that's what you're talking about here) as follows
by using the onSelectRow to set the url on the grid to be 'affected'..
jQuery("#userGrid").jqGrid({ "datatype":"json", "rowNum":10, ...
... 'onSelectRow':function(id, status) { jQuery('#userDetailsGrid').setGridParam({ url:'jsonRequest.php?JSONRequestType=details&userId='+id, page:1 }) .trigger('reloadGrid'); }, ...
... };
Note: looks like $(window.location).attr('href') is something you should avoid generally as it's broken in 1.4.3 and 1.4.4 - see http://bugs.jquery.com/ticket/7607
精彩评论