ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: Fraan83 on December 12, 2019, 06:50:36 pm

Title: what is the correct way to refresh grid by an external button?
Post by: Fraan83 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>




Title: Re: what is the correct way to refresh grid by an external button?
Post by: paramvir 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.