Angular-ui-grid: disable click sorting for header cells

I want to disable sorting for the on-click event of the header cell, and the sort option should only be available in the header dropdown menu. I tried using the enableSorting property to disable sorting for the on-click event. But it also removes the collation from the header.

Here is the plunker link: http://plnkr.co/edit/J6XnIAb7E3MZe62Ixax3?p=preview

HTML:

<div id="grid1" ui-grid="gridOptions1" class="grid"></div>

      

JS:

  $scope.gridOptions1 = {
    enableSorting: true,
    columnDefs: [
      { field: 'name' },
      { field: 'gender' },
      { field: 'company', enableSorting: false }
    ],
    onRegisterApi: function( gridApi ) {
      $scope.grid1Api = gridApi;
    }
  };

      

+3


source to share





All Articles