This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » Javascript plugins » JQgrid header searchable
JQgrid header searchable [message #100481] Sat, 05 June 2010 12:01
xidy  is currently offline xidy
Messages: 1
Registered: June 2010
Junior Member
Hi, I need to implement JQgrid width header searcheable (in toolbar)like this toolbarsearch

But I don't know how to make the filters, how to comlete my actions. I use doctrine an Symfony 1.4

Thanks in advance

Here's my HTML code :

<div id="searchContact">
                                <table id="rechercheContact"></table>
                                <div id="ptoolbar" ></div>

Here's my JS code :

            datatype: "json",
            loadtext: "Chargement",
            height: 250,
            jsonReader : {root:"cellule"},
            emptyrecords: "Aucun enregistrement",
            colNames:['Nom','Prenom','Localite','Code Postal','Commentaire'],
                {name:'Nom',index:'Nom', sortable: false },
                {name:'Prenom',index:'Prenom', sortable: false},
                {name:'Localite',index:'Localite', sortable: false},
                {name:'CodePostal',index:'CodePostal', sortable: false},
                {name:'Commentaire',index:'Commentaire', sortable: false},
            scrollOffset: 0,
            sortname: 'Nom',
            $sortorder: 'asc',
            caption: "Contact(s)",
            viewrecords: true

        jQuery("#rechercheContact").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false});

and finally my action:

public function executeTrouverContact(sfWebRequest $request) {

    $this->contacts = Doctrine_Query::create()
    ->from('Contact c')
    ->where('nom LIKE \'%'.$request->getParameter('recherche').'%\'')
    ->orWhere('prenom LIKE \'%'.$request->getParameter('recherche').'%\'')
    ->orWhere('code_postal LIKE \'%'.$request->getParameter('recherche').'%\'')
    ->orWhere('localite LIKE \'%'.$request->getParameter('recherche').'%\'')
    ->orWhere('commentaire LIKE \'%'.$request->getParameter('recherche').'%\'')

        $inscriptions = array();
        if ($request->isXmlHttpRequest()) {

                if (!is_null($this->contacts) && !empty($this->contacts)) {

                    $id = 1;

                        foreach ($this->contacts as $contact) {
                            $inscriptions['cellule'][] = array(
                                    'id'        => "$id",
                                    'cell'      => array($contact->getNom(),$contact->getPrenom(),


                    $this->getResponse()->setHttpHeader('Content-Type','application/json; charset=utf-8');
                    $inscriptions = $this->renderText(json_encode($inscriptions));
        return $inscriptions;
Previous Topic:atolExt3WidgetPlugin
Next Topic:Dialog Box for Symfony 1.4
Goto Forum:

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software