1

I have a few grids that using same code to generate the grid and in all of them the refresh button in grid footer is disabled. There is one grid that I need to show refresh button on it. How can I show the refresh button after generating the grid?

Here is the code that generates the grid.

$('#Grid1_grid').jqGrid({
  datatype: 'local',
  data: gridData.records,
  colNames: gridData.colNames,
  colModel: gridData.colModel,
  rowNum: 20,
  shrinkToFit: false,
  autowidth: true,
  rowList: [10,20,50],
  caption: 'Promotion List',
  pager: jQuery('#Grid1_pager'),
  sortname: 'id',
  height: '100%',
  viewrecords: true
}).navGrid('#Grid1_pager', { edit: false, add: false, del: false ,search:false, refresh:false});

In other words, I want to set refresh = true later in code to show the refresh button of the pager.

AaA
  • 3,600
  • 8
  • 61
  • 86

1 Answers1

1

One can't show the "Refresh" button if the button was not created. So I suggest you to create always the button and show/hide it. The details for the implementation you will find in the answer.

I posted some months before the feature request with suggestion to change a little the main code of jqGrid (the code of navGrid) to solve the problem, but the feature request stay unanswered.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798