Author Topic: what is the correct way to refresh grid by an external button?  (Read 1747 times)

Fraan83

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 9
    • View Profile
what is the correct way to refresh grid by an external button?
« on: December 12, 2019, 06:50:36 pm »
Dear paramvir,
 
I'm still here with my ignorance.

I tried to make a button in a page that only refreshes the grid, but it doesn't work.

I simpy did:

 
Code: [Select]

 <div id="grid" style="margin: 0px auto;"></div>

 <button id="btn_refresh_grid" type="button" > Refresh</button>


<script>
          $( "#btn_refresh_grid" ).click(function() {
               var grid = $('div#grid').pqGrid("getInstance").grid;
               grid.refreshDataAndView();
             
           });
</script>





paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: what is the correct way to refresh grid by an external button?
« Reply #1 on: December 12, 2019, 08:07:50 pm »
Apparently your code is fine.

1. Please define your expectation from the function call and how it doesn't fulfill your requirement.

2. Do you get any error in the browser developer console.