I've been searching for a solution to my situation for a couple of days now, and I cannot seem to find anything that could help me.
I am allowing my users the make a custom search on the DB using a simple form, and then the server sends back a JSON encoded object that represents the results(this part functions properly).
The problem is that the grid is not being refreshed, and I cannot seem to display those results.
I've tried to do the following thing, but it just refreshes the grid one more time and then shows me all of the results without any search being made.
Can I adjust jqgrid in a certain way to display the search results?.
After I'll accomplish this, I would also like to combine my system with the sorting and paging abilities of jqgrid(allow my customers to page and sort their results).
Thanks for your help in advance guys!.
enter code here
$(function() {
$("#list2").jqGrid({
url:'applicants.temp.php',
datatype: "json",
width: 900,
height: 300,
scroll: false,
shrinktofit: false,
gridview: true,
direction: '<?=$web_direction?>',
colNames:['id', '<?=$mylabel["last_updated"]?>', '<?=$mylabel["job_title"]?>', '<?=$mylabel["applicant_name"]?>', '<?=$mylabel["cv_filename"]?>', '<?=$mylabel["referer_name"]?>',
'<?=$mylabel["note"]?>', '<?=$mylabel["media_id"]?>', '<?=$mylabel["ref_type"]?>', '<?=$mylabel["job_internal_id"]?>', 'status_id', 'job_id', ''],
colModel:[
{name: 'id',index:'2', width:10, hidden: true, align:'<?=$col_direction?>'},
{name:'last_updated', index:'1', width:20, align:'<?=$col_direction?>'},
{name:'job_title',index:'8', width: 20, align:'<?=$col_direction ?>'},
{name:'applicant_name', index:'3', width:40, align:'<?=$col_direction?>'},
{name:'cv_filename',index:'11', width:30, align:'center'},
{name:'referer_name', index:'4', width:40, align:'<?=$col_direction?>'},
{name:'note',index:'10', width:60, align:'<?=$col_direction?>'},
{name:'media_id',index:'5', width:20, align:'<?=$col_direction?>'},
{name:'ref_type',index:'6', width:20, align:'<?=$col_direction?>'},
{name:'job_internal_id',index:'9', width:15, hidden: false, align:'
<?=$col_direction?>'},
{name:'status_id',index:'12', hidden:true, width:0, align:'<?=$col_direction? >'},
{name:'job_id',index:'7', hidden:true, width:0, align:'<?=$col_direction?>'},
{name:'empty', width:60, sortable:false ,index:'13', hidden:'hidden', align:'center'}
],
rowNum:20,
rowList:[20,40,60],
pager: '#pager2',
sortname: '1',
viewrecords: true,
sortorder: "DESC",
caption:"<?=get_phrase("Applicants")?>",
loadonce:false,
postData: { medias: function(){return $("#medias option:selected").val();},
types: function(){return $("#types option:selected").val();},
jobs: function(){return $("#jobs option:selected").val();},
applicant: function(){return $("#applicant").val();},
referrer: function(){return $("#referrer").val();} }
});
});