
$.ui.dialog.defaults.bgiframe = true;
function rechercher(jeux,console){
  
  $("#recherche").dialog('open');
  
  $("#rec-langues").load("box_langue.php?recherche="+ encodeURIComponent(jeux));
  
  jQuery("#list-recherche").GridUnload()
  jQuery("#list-recherche").jqGrid({
    url:'/query1.php?recherche='+jeux+'&console='+console,
    datatype: 'json',
    mtype: 'GET',
    colNames:['id','con','Console','title','prix','Prix Amazon'],
    colModel :[ 
      {name:'id', index:'invid', width:55,hidden:true},
      {name:'console', index:'console', width:40,hidden:true},
      {name:'console_img', index:'console_img', width:40},
      {name:'title', index:'title', width:350},
      {name:'prix', index:'prix', width:60,align:"center"}, 
      {name:'prix_amazon', index:'prix', width:60,align:"center"}, 
      ],
      
    height: 350, 
    sortname: 'title',
    sortorder: "desc",
    viewrecords: true,
    imgpath: 'themes/basic/images',
    caption: 'Recherche : '+jeux,
    
    subGrid: true,
    subGridUrl : "/query1.php?q2=on&manuel=on",
    subGridModel: [ {
      name:  ['Prix','Port','Prix total','Boutique','Stock','Delais','Lien'],
      width : [53,45,53,120,120,85,80 ],
      params: ['title','console'] }
    ]
    
   
    
    

  }); 

}



$(document).ready(function(){
  
  
  $("#recherche").dialog({
			bgiframe: true,
			autoOpen: false,
			height: 400,
		  width: 610,
			modal: true
		});
  
    $("#loader").hide();
    $("#JeuxParImage").hide(); 
   
   $("#chercher").click(function() {
    rechercher( $("#txtRecherche").val(),0 )
   
  });
   
 });
