Forum



12:06

13/09/2012

Hi all , this is my first time using jqgrid, and i can't get that search toolbar to work, nothing happens when i type in search inputs.
I already read topics concerning toolbar search on this forum but i didnt manage to understand what's wrong with my code...
Php generates the xml file like this:
$s .= "<suppr><![CDATA[<span class=\"ui-icon ui-icon-closethick\" style=\"cursor:pointer;\" title=\"Enlever ce QCM de la liste des Quiz disponibles\" onclick=\"supprQCM(".$id_qcm.")\"></span>]]></suppr>";
$s .= "<libelle_qcm><![CDATA[". $libelle_qcm ."]]></libelle_qcm>";
$s .= "<service_qcm><![CDATA[". $service_qcm ."]]></service_qcm>";
$s .= "<atelier_qcm><![CDATA[". $atelier_qcm ."]]></atelier_qcm>";
$s .= "<fonction_qcm><![CDATA[". $fonction_qcm ."]]></fonction_qcm>";
$s .= "<theme_qcm><![CDATA[". $theme_qcm ."]]></theme_qcm>";
$s .= "<positionnement><![CDATA[". $positionnement."]]></positionnement>";
$s .= "<chemin_fichier><![CDATA[". $chemin_fichier."]]></chemin_fichier>";
$s .= "<date><![CDATA[". $date ."]]></date>";
$s .= "<revision><![CDATA[". $revision ."]]></revision>";
$s .= "<etat><![CDATA[". $etat ."]]></etat>";
$s .= "</row>";
And my jqGrid code looks like this :
url:'gestion_qcm_grid.php?q=1',
datatype: 'xml',
mtype: 'GET',
colNames:['<span class="ui-icon ui-icon-closethick"></span>', 'Nom du QCM', 'Service', 'Atelier', 'Fonction', 'Thème', 'Positionnement', 'Chemin Fichier', 'Date', 'Révision', 'État'],
colModel :[
{name:'suppr', xmlmap:'suppr', width:12, sortable:false, search:false, align:'center'},
{name:'libelle_qcm', xmlmap:'libelle_qcm', width:150, align:'center', searchrules:{custom:true}, search:true},
{name:'service_qcm', xmlmap:'service_qcm', width:100, align:'center'},
{name:'atelier_qcm', xmlmap:'atelier_qcm', width:100, align:'center'},
{name:'fonction_qcm', xmlmap:'fonction_qcm', width:150, align:'center'},
{name:'theme_qcm', xmlmap:'theme_qcm', width:80, align:'center'},
{name:'positionnement', xmlmap:'positionnement', width:80, align:'center'},
{name:'chemin_fichier', xmlmap:'chemin_fichier', width:300, sortable:false, search:false, align:'center'},
{name:'date', xmlmap:'date', width:80, align:'center'},
{name:'revision', xmlmap:'revision', width:20, sorttype:"int", align:'center'},
{name:'etat', xmlmap:'etat', width:20, align:'center'}
],
pager: '#pager',
rowNum:25,
rowList:[25,50,100],
sortname: 'service_qcm',
viewrecords: true,
gridview: true,
ignoreCase:true,
xmlReader: {
root : "rows",
row: "row",
repeatitems: false,
id: "ASIN"
},
sortorder: 'asc',
caption: ' Ces QCMs sont disponibles pour le groupe d\'utilisateur associé :',
loadComplete:onGridComplete
});
jQuery("#tableConsult").jqGrid('filterToolbar', {stringResult: true, searchOnEnter: false, defaultSearch : "cn"});
My grid is filled correctly with my data, i can see and type in search inputs, but nothig happens ...
What do i forget or what are my errors ? I read the doc but can't find what's wrong...
Please save my life I'm working on this since yesterday and i'm going to be bald if i continue to walk round and round ...
17:08

13/09/2012

Hi again, I found a solution to thos by adding
loadonce:true,
in jqgrid parameters. It's quite logical cause i thought jqgrid would search inside DB calling a php script, but I think my code was lacking of "WHERE" parameters to do that. so by adding this line, jqgrid seems to search the grid locally, and my search toolbars work fine, but locally...
have a nice day.
bye.
Most Users Ever Online: 715
Currently Online:
44 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66