title: Need to show the default sort column icon in jqgrid
body: <p>I have to show the sort column icons in a Jqgrid. I have found answers here itself. I tried with that, now I can able to see the sort icons on all sortable column headers, but the default sort column is not showing the highlighted icon.</p>
  
  <p>This is my script :</p>
  
  <pre><code>var $tempX= $(divId), colModel, sortName;
  
  
      jQuery(divId).jqGrid({
          datatype: "local",
          height: 250,
          width:1000,
          colNames:eval(colNamesVal),
          colModel:eval(colModelVal),
          rowNum:35, 
          rowList:[35,60,100,1000000000],
          rownumbers: true,
          rownumWidth:50,
          height:"auto",
          pager: '#pager2',
          ignoreCase: true,
          //altRows:true,
          pagination:true,
          headertitles:true,
          sortable:true,
          sortorder: "asc",
          viewrecords: true,
          onSortCol: function (index, idxcol, sortorder) {
              if (this.p.lastsort &gt;= 0 &amp;&amp; this.p.lastsort !== idxcol
                      &amp;&amp; this.p.colModel[this.p.lastsort].sortable !== false) {
                  // show the icons of last sorted column
                  $(this.grid.headers[this.p.lastsort].el)
                      .find("&gt;div.ui-jqgrid-sortable&gt;span.s-ico").show();
                  $(this.grid.headers[this.p.lastsort].el).removeClass('sortedColumnHeader');
              }
              $(this.grid.headers[idxcol].el).addClass('sortedColumnHeader');
          },
          loadComplete: function(){
              $("option[value=1000000000]").text('All');
          } 
      });
  
  colModel = $tempX.jqGrid('getGridParam', 'colModel');
      sortName = $tempX.jqGrid('getGridParam', 'sortname');
      $('#gbox_' + $.jgrid.jqID($tempX[0].id) +
          ' tr.ui-jqgrid-labels th.ui-th-column').each(function (i) {
          var cmi = colModel[i], colName = cmi.name;
  
          if (cmi.sortable !== false) {
              // show the sorting icons
              $(this).find('&gt;div.ui-jqgrid-sortable&gt;span.s-ico').show();
          } else if (!cmi.sortable &amp;&amp; colName !== 'rn' &amp;&amp; colName !== 'cb' &amp;&amp; colName !== 'subgrid') {
              // change the mouse cursor on the columns which are non-sortable
              $(this).find('&gt;div.ui-jqgrid-sortable').css({cursor: 'default'});
          }
          if (cmi.name === sortName) {
              $(this).addClass('sortedColumnHeader');
          }
      });
  </code></pre>
  
  <p>Can anybody help in this?
  Thanks!</p>