Hello, Basically jqGrid first check if the grid exists. If the grid does not exists the plugin create the grid and data is populated. If the grid exists nothing is happen. In other words you try to call every time jqGrid on already created grid. To avoid this there are a lot of scenarious. 1. Create a empty second grid and hide them (if you want) 2. Then after every double click do something like this
jQuery("#list3").setGridParam({url:'get_services.php?name='+x}).trigger ("reloadGrid") Best Regards Tony On Apr 7, 10:21 pm, "Natkeeran L.K." <natkee...@gmail.com> wrote: > Hello: > > I am trying to develop a similar functionality as here:http:// > koshersavings.ca/SelectItems.php > > When the user to clicks an row item, I want items to be loaded based > on the selection, dynamically. > > I am trying to do the same, but usingjqgrid, and ajax. > > The current code is here: (also note > below)http://pssnet.com/~devone/ajqtable/summary35.html > > Basically, when the user double clicks it loads a corresponding > table. But, when they select another, it will not reloaded. Any help > appreciated. Thanks. > > Regards, > Nat > > ondblClickRow: function(id){ > var x = id; > alert("You double click row with id: "+id); > > // Load Dynamic Data > jQuery("#list3").jqGrid({ > datatype: function(postdata){ > jQuery.ajax({ > url:'get_services.php?name='+x, > data:postdata, > > datatype: "json", > complete: function (jsondata, stat){ > if(stat=="success"){ > var thegrid = > jQuery("#list3")[0]; > > thegrid.addJSONData(eval("("+jsondata.responseText+")")); > > alert("yes"); > } > else{ > > alert("no"); > } > } // end > complete > }); // end ajax > }, // end datatype > > colNames:['Product No', 'Name', 'type'], > > colModel:[ > > {name:'product_id',index:'product_id', > width:75}, > > {name:'name',index:'name', width:100}, > > {name:'type',index:'type', width:100}, > > ], > > pager: jQuery('#pager3'), > > rowNum:10, > > rowList:[10,20,30], > > imgpath: 'themes/sand/images', > > sortname: 'id', > > viewrecords: true, > > sortorder: "asc" > }); > > }, //end ondblClickRow function