Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Search Toolbar with XML not working
13/09/2012
12:06
Avatar
ashensugar
New Member
Members
Forum Posts: 2
Member Since:
13/09/2012
sp_UserOfflineSmall Offline

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:

[... server connexion & data retrieving]

    $s .= "<row id='". $id_qcm."'>";
    $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 :

jQuery("#tableConsult").jqGrid({
        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: '&nbsp;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 ... Confused

20/09/2012
17:08
Avatar
ashensugar
New Member
Members
Forum Posts: 2
Member Since:
13/09/2012
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
34 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information