Note that there are some explanatory texts on larger screens.

plurals
  1. POSorting icon not updating on setting the sortorder
    primarykey
    data
    text
    <p>I am trying to change the sorting order of jqGrid by using this code:</p> <pre><code>jQuery('#id').setGridParam({sortorder:"desc"}).trigger("reloadGrid"); </code></pre> <p>It changes the sortorder of the table but the Sorting Icon of the table is not changing as per the order. In onSortCol i'm sorting the column which actually sort the column. But when i use the above piece of code to set the sortorder, the sortorder is set but the sort icon still shows the previous sortorder.</p> <pre><code>_table.jqGrid({ datatype: 'local', // disable initial autoload. this will be when load function is called "json", altRows: true, altclass : 'AltRowClass', gridView: true, width:850, height:"auto", rowheight: 75, align: 'center', treeGrid: false, loadonce:true, ExpandColumn: 'name', loadtext : 'Currently updating', mtype : 'POST', colNames: ['MSISDN','IMSI','Last name','First name','Device type','CE Index','Customer lifetime value'], colModel: [ { name: 'MSISDN', align: 'center', hidden: false, sortable: false,formatter: maskingColumn}, { name: 'IMSI', align: 'center', hidden: false, sortable: false,formatter: maskingColumn}, { name: 'LastName', align: 'center', hidden: false, sortable: false}, { name: 'FirstName', align: 'center', hidden: false, sortable: false}, { name: 'DeviceType', align: 'center', hidden: false, sortable: false,formatter: columnData}, { name: 'CEIndex', align: 'center', hidden: false, sortable: true, sorttype: 'int'}, { name: 'CustomerLifetimeValue', align: 'center', hidden: false, sortable: false} ], sortname: 'CEIndex', sortorder: 'desc', loadComplete: function(data) { var rowCount = _table.jqGrid('getGridParam', 'records'); if (rowCount &gt; 5) { _table.parents("div.ui-jqgrid-bdiv").css({'max-height':'300px'}); _table.closest(".ui-jqgrid-bdiv").css({'overflow-y':'auto'}).css({'overflow-x':'hidden'}); } if (rowCount != 0) { _table.parents().find('.ui-jqgrid-view').first().show(); } if (rowCount &lt;= rowsNum) { utils.find('cei-drill-customer-detail-showmore').hide(); } else { utils.find('cei-drill-customer-detail-showmore').show(); } _table.trigger("reloadGrid"); } , onSortCol: function (data, status, xhr) { if (xhr == 'asc') { var postData = this.p.postData.jsonRequest.replace('Top','Bottom'); actionInputObjectExportCustDrilldown.parameters.requestQuery = actionInputObjectExportCustDrilldown.parameters.requestQuery.replace('Top','Bottom'); var postDataVar = { operation : 'drillDownLevel1', drillLevel1 : "drilldown", jsonRequest : postData }; _this.load(postDataVar); } else if (xhr == 'desc') { var postData = this.p.postData.jsonRequest.replace('Bottom','Top'); actionInputObjectExportCustDrilldown.parameters.requestQuery = actionInputObjectExportCustDrilldown.parameters.requestQuery.replace('Bottom','Top'); var postDataVar = { operation : 'drillDownLevel1', drillLevel1 : "drilldown", jsonRequest : postData }; _this.load(postDataVar); } }, beforeProcessing : function(data, status, xhr) { jQuery('div#jqgh_' + prefix + '-cei-dd-customer-details-table_CustomerLifetimeValue.ui-jqgrid-sortable').text("Customer Lifetime Value(" + filterValuesHl.currency + ")"); if (data.queryError != null || !data.rows || data.rows.length == 0) { utils.find('cei-drill-customer-detail-ExportShowMore').hide(); utils.find('div-for-export-customer').hide(); var noError = utils.find('cei-customerDetails-div').parent().find(".cei-customer-details-dd-no-data"); if (data.queryError != null) { noError.text("Error in portlet: " + data.queryError); } else { noError.html("&lt;strong&gt;No Data Available&lt;/strong&gt;"); } noError.show(); return false; } else { utils.find('cei-drill-customer-detail-ExportShowMore').show(); utils.find('div-for-export-customer').show(); utils.find('cei-drill-customer-detail-showmore').show(); //Hiding the columns which has no data in all the rows. hideColumns(data); //Setting CSV Data csvData = data; } }, beforeRequest : function() { _table.parents().find('.ui-jqgrid-view').first().hide(); utils.find('cei-customerDetails-div').parent().find(".cei-customer-details-dd-no-data").hide(); }, loadError : function(xhr, st, err) { utils.find('cei-drill-customer-detail-ExportShowMore').hide(); utils.find('div-for-export-customer').hide(); var noError = utils.find('cei-customerDetails-div').parent().find(".cei-customer-details-dd-no-data"); noError.html("&lt;html&gt;Error connecting portlet: " + err + "&lt;/strong&gt;"); noError.show(); } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload