$(document).ready(function() { // cette fonction est nécessaire pour IE car les éléments doivent etre chargés dabord
	jQuery("#list5").jqGrid({        
		url:'inc/jgrid/php_maquillage_avant_premiere.php?nd='+new Date().getTime(),
		datatype: "json",
		colNames:['Saison' , 'Societé' , 'Marque', 'Produit'],
		colModel:[
			{name:'saison',index:'saison', width:89},
			{name:'societe',index:'societe', width:157},
			{name:'marque',index:'marque', width:163},
			{name:'nom_produit',index:'nom_produit', width:214}
		],
		rowNum:20,
		rowList:[10,20,30,50,100],
		imgpath: gridimgpath,
		pager: jQuery('#pager5'),
		sortname: 'id',
		viewrecords: true,
		sortorder: "desc",
		caption:"Liste de la catégorie Maquillage",
		editurl:"someurl.php"
	}).navGrid("#pager5",{edit:false,add:false,del:false});
/*	jQuery("#a1").click( function(){
		var id = jQuery("#list5").getGridParam('selrow');
		if (id)	{
			var ret = jQuery("#list5").getRowData(id);
			alert("id="+ret.id+" invdate="+ret.invdate+"...");
		} else { alert("Please select row");}
	});
	jQuery("#a2").click( function(){
		var su=jQuery("#list5").delRowData(12);
		if(su) alert("Succes. Write custom code to delete row from server"); else alert("Allready deleted or not in list");
	});
	jQuery("#a3").click( function(){
		var su=jQuery("#list5").setRowData(11,{amount:"333.00",tax:"33.00",total:"366.00",note:"<img src='images/user1.gif'/>"});
		if(su) alert("Succes. Write custom code to update row in server"); else alert("Can not update");
	});
	jQuery("#a4").click( function(){
		var datarow = {id:"99",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"};
		var su=jQuery("#list5").addRowData(99,datarow);
		if(su) alert("Succes. Write custom code to add data in server"); else alert("Can not update");
		
	});*/
	// ici si on clic sur une ligne du tableau
	jQuery("#list5").setGridParam({onSelectRow: function(id){
		//alert(id);	
		document.location = "showproduit.php?id=" + id  + "&pPremiere=11" ;
	}});
});
