jsp - Two JQGrid in one page -


i new in ajax, jquery.

right using 2 jqgrid rendering data.

jquery('#oldlocations').jqgrid(             {                 url:"/",                 datatype : 'json',                 width:400,                 height:120,                 colnames:['customer'],                 colmodel:[                     {name:'custid',index:'custid',align:'center',hidden:true,sortable:false,editable:true,edittype:"text",editrules:{required:true,number:true}},                  ],                 pager: '#pager1',                 viewrecords: false,                 editurl:'donothing',                 emptyrecords: "nothing display",                 multiselect:false,                 rownum : 5,                 rowlist : [ 5, 10, 15 ],                 loadonce:true,                 imgpath : "themes/basic/images",                 caption : ""             });              jquery('#newlocations').jqgrid(             {                 url:"/",                 datatype : 'json',                 width:400,                 height:120,                 colnames:['list of users under customers'],                 colmodel:[                     {name:'custid',index:'custid',align:'center',sortable:false,hidden:true,editable:true,edittype:"text",editrules:{required:true,number:true}},                  ],                 pager: '#pager2',                 viewrecords: false,                 editurl:'donothing',                 emptyrecords: "nothing display",                 multiselect:false,                 rownum : 5,                 rowlist : [ 5, 10, 15 ],                 loadonce:true,                 imgpath : "themes/basic/images",                 caption : ""             });    loading 2 grids after clicking on search button.    $("#searchcarbtn").click(function() {    jquery("#oldlocations").jqgrid('setgridparam',{url:urlstr1,mtype: 'post',async:false ,datatype:'json'}).trigger("reloadgrid");  jquery("#newlocations").jqgrid('setgridparam',{url:urlstr2,mtype: 'post',datatype:'json'}).trigger("reloadgrid");  } 

the ajax calls need call 1 one. means second call dependent on first. first need called first , after second. right not happening. second call executes first. tried making flag , calling second not working.

like.

var flag = 0; if(flag == 0) {        first;         flag = 1; }  if(flag == 1) {     second call. //but not working. } 


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -