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
local multisort trigger("reloadGrid") does not work - jqGrid 4.5.2 - jQuery-1.9.0
02/07/2013
12:29
Avatar
jean007
FRANCE, PARIS
New Member
Members
Forum Posts: 2
Member Since:
02/07/2013
sp_UserOfflineSmall Offline

We have a table with local data. We want to sort from multi hidden fields and activated via a select. A click on the desired sort triggers the action "gridSortActions". But the grid is not displayed sorted and remains in the initial state with the default multi sorting fields.

Below, we provide you the html select, the "gridSortActions" action code, the local data and the configuration of the grid.

We are not where we see a mistake.

<div class="actionOrder">

  <div id="exf_searchActions" class="gridSortActions">
     <label id="exf_searchActionsLabel" class="gridSortActionsLabel">Trié par</label>
     <select id="exf_searchActionsList" class="gridSortActionsList"
onclick="gridSortActions(this, this.value, this.order, 'exf_search'); return false;">
       <option value="to_transmit desc, order asc, pgr_dat_begin" order="desc">Représentations les plus récentes</option>
       <option value="to_transmit desc, order asc, exf_lbl_title" order="asc">Titre du spectacle</option>
    </select>
  </div>
</div>

function gridSortActions(elementXvo, actionNameXvs, orderXls, gridIdXls)
{
    var attributesXla = null,
        indexXli      = 0,
        lengthXli     = 0,
        sortnameXls   = '',
        sortorderXls  = '';
    if (elementXvo.type == 'select-one')
    {
        attributesXla = elementXvo.options[elementXvo.selectedIndex].attributes;
        for(indexXli = 0, lengthXli = attributesXla.length; indexXli < lengthXli; indexXli++)
        {
            if (attributesXla[indexXli].name === 'order')
            {
                sortorderXls = attributesXla[indexXli].value;
                continue;
            }
            if (attributesXla[indexXli].name === 'value')
            {
                sortnameXls = attributesXla[indexXli].value;
                continue;
            }
        }
        jQuery('#'+gridIdXls).jqGrid('setGridParam', {sortname:sortnameXls, sortorder: sortorderXls});
        jQuery('#'+gridIdXls).trigger("reloadGrid", [{page:1}]);
        jQuery('#'+gridIdXls).applyRowSpan();
    }
    else
    {
        jQuery('#'+gridIdXls).jqGrid('setGridParam', {sortname:actionNameXvs, sortorder: orderXls});
        jQuery('#'+gridIdXls).trigger("reloadGrid", [{page:1}]);
        jQuery('#'+gridIdXls).applyRowSpan();
    }
}

var dataexf_search = [
{"order":1,"to_transmit":0,"to_transmit_text":"","exf_id":"20651748","exf_id_reffile":"246807","exf_lbl_title":"LE
REPAS DES FAUVES","pgr_dat_begin":"01/02/2010","pgr_dat_range":"01/02/2010 - 01/02/2010","contributors_nam_lbl_name":"HEDIN","producer_nam_lbl_name":"MINUS ET CORTEX,93500 PANTIN","menuContent":{"menu":{"elements":[{"url":"http://129.134.93.176/~jra/mig;,"state":true,"title":"Choisir ce dossier","alt":"Traiter ce dossier"},{"url":"http://129.134.93.176/~jra/mig;,"state":true,"title":"Voir le du00e9tail des oeuvres","alt":"Du00e9tail de lu0027oeuvre"}]}}},
{"order":0,"to_transmit":1,"to_transmit_text":"Attention: il reste des informations u00e0 transmettre.","exf_id":"20759506″,"exf_id_reffile":"256475″,"exf_lbl_title":"LA NUIT DES REINES","pgr_dat_begin":"11/01/2013″,"pgr_dat_range":"11/01/2013 – 30/03/2013″,"contributors_nam_lbl_name":"","producer_nam_lbl_name":"BASTILLE PRODUCTIONS,75012 PARIS","menuContent":{"menu":{"elements":[{"url":"http://129.134.93.176/~jra/mig;,"state":true,"title":"Choisir ce dossier","alt":"Traiter ce dossier"},{"url":"http://129.134.93.176/~jra/mig;,"state":true,"title":"Voir le du00e9tail des oeuvres","alt":"Du00e9tail de lu0027oeuvre"}]}}},
{"order":1,"to_transmit":0,"to_transmit_text":"","exf_id":"717107067″,"exf_id_reffile":"528762″,"exf_lbl_title":"LA NUIT DES DUPES","pgr_dat_begin":"11/01/2013″,"pgr_dat_range":"11/01/2013 – 29/03/2013″,"contributors_nam_lbl_name":"HEIM","producer_nam_lbl_name":"BASTILLE PRODUCTIONS,75012 PARIS","menuContent":{"menu":{"elements":[{"url":"http://129.134.93.176/~jra/mig;,"state":true,"title":"Choisir ce dossier","alt":"Traiter ce dossier"},{"url":"http://129.134.93.176/~jra/mig;,"state":true,"title":"Voir le du00e9tail des oeuvres","alt":"Du00e9tail de lu0027oeuvre"}]}}},
{"order":1,"to_transmit":0,"to_transmit_text":"","exf_id":"1392342347″,"exf_id_reffile":"551024″,"exf_lbl_title":"ADIEU JE RESTE","pgr_dat_begin":"01/04/2013″,"pgr_dat_range":"01/04/2013 – 01/04/2013″,"contributors_nam_lbl_name":"CZERKINSKY","producer_nam_lbl_name":"THEATRE DES VARIETES,75002 PARIS","menuContent":{"menu":{"elements":[{"url":"http://129.134.93.176/~jra/mig;,"state":true,"title":"Choisir ce dossier","alt":"Traiter ce dossier"},{"url":"http://129.134.93.176/~jra/mig;,"state":true,"title":"Voir le du00e9tail des oeuvres","alt":"Du00e9tail de lu0027oeuvre"}]}}},{"order":1,"to_transmit":0,"to_transmit_text":"","exf_id":"1724424415″,"exf_id_reffile":"566907″,"exf_lbl_title":"Zorro","pgr_dat_begin":"01/03/2013″,"pgr_dat_range":"01/03/2013 – 17/03/2013″,"contributors_nam_lbl_name":"CAMORS","producer_nam_lbl_name":"ID PROSCENIUM,75002 PARIS","menuContent":{"menu":{"elements":[{"url":"http://129.134.93.176/~jra/mig;,"state":true,"title":"Choisir ce dossier","alt":"Traiter ce dossier"},{"url":"http://129.134.93.176/~jra/mig;,"state":true,"title":"Voir le du00e9tail des oeuvres","alt":"Du00e9tail de lu0027oeuvre"}]}}}];

jQuery("#exf_search").jqGrid(
{
data: dataexf_search,
datatype: "local",
height: '100%',
shrinkToFit: true,
width: '100%',
colNames: ["","","","","","","","","Dossier","Dates",""],
colModel: [
{index:"order", name:"order", title: false, width:1, sorttype:"integer", formatter:"integer",
 formatoptions: {thousandsSeparator:" ", defaultValue:"0"}, hidden:true, sortable:true, firstsortorder:"asc"},{index:"to_transmit", name:"to_transmit", title: false, width:1, sorttype:"text", formatter:"text", 
 hidden:true, sortable:true, firstsortorder:"asc"},{index:"to_transmit_text", name:"to_transmit_text", title: 
 false, width:1, sorttype:"text", formatter:"text", hidden:true},
{index:"exf_id_reffile", name:"exf_id_reffile", title: false, width:1, sorttype:"text", formatter:"text",
 hidden:true, sortable:true, firstsortorder:"asc"},
{index:"exf_lbl_title", name:"exf_lbl_title", title: false,
 width:1, sorttype:"text", formatter:"text", hidden:true, sortable:true, firstsortorder:"asc"},{index:"contributors_nam_lbl_name", name:"contributors_nam_lbl_name", title: false, width:1, sorttype:"text",
 formatter:"text", hidden:true},
{index:"producer_nam_lbl_name", name:"producer_nam_lbl_name", title: false, width:1, sorttype:"text",
 formatter:"text", hidden:true},
{index:"pgr_dat_begin", name:"pgr_dat_begin", title: false, width:1, sorttype:"date", formatter:"date",
 formatoptions: {srcformat: "d/m/Y", newformat: "d/m/Y"}, hidden:true, sortable:true, firstsortorder:"desc"},{index:"dossier", name:"dossier", title: false, width:650, sortable: false, search: false,
 formatter:concatFmatter, formatoptions: {fields:
 ["to_transmit_text","exf_id_reffile","exf_lbl_title","contributors_nam_lbl_name","producer_nam_lbl_name"], 
 format:'<div class="subField"><span class="text red">$1</span></div><div class="subField"><div
 class="exf_id_reffile"><span class="label">common.ref</span><span class="text">$2</span></div><span
 class="label">Spectacle</span><span class="text">$3</span></div><div class="subField"><span
 class="label">common.contributors</span><span class="text">$4</span></div><div class="subField"><span
 class="label">common.producer</span><span class="text">$5</span></div>'}, align:"left"},{index:"pgr_dat_range", name:"pgr_dat_range", title: false, width:215, sorttype:"text", formatter:"text",
 sortable:false, firstsortorder:"asc", align:"left"},
{index:"menuContent", name:"menuContent", title: false, width:80, sortable: false, search: false,
 formatter:menuFmatter, formatoptions: { title: "Agir", alt: "Actions sur le dossier", type: "static"},
 align:"left"}],
rowNum: 5,
rowTotal: 5,
rowList : [3,6,9,12,24],
loadonce: true,
mtype: "POST",
scroll: false,
autowidth: true,
altRows: true,
altclass: 'gridAlternateRow',
forceFit: true,
rownumbers: false,
hoverrows: false,
gridview: false,
sortname: "to_transmit desc, order",
sortorder: "asc",
multiSort: true,
viewrecords: false,
});
Forum Timezone: Europe/Sofia

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.com

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information