Author Topic: How to load data on button click rather than loading by default  (Read 1648 times)

harishn007

  • Newbie
  • *
  • Posts: 3
    • View Profile
I am understanding the concepts of PQGRID and have found it of great use.
But there one thing that I am finding difficulty is in loading data on click of a button rather than loading by default.

Hope you'll help me with same.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile

harishn007

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to load data on button click rather than loading by default
« Reply #2 on: August 27, 2021, 11:11:23 pm »
Thank you sir for your reply to my query

The data is loaded from "remote", which is what I am using.
But I don't want to populate or get data when the grid gets initialized,
I want the user to click a button and load the data.

I want to stop the default loading.

harishn007

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to load data on button click rather than loading by default
« Reply #3 on: August 30, 2021, 04:11:58 pm »
Please help me sir to integrate the same in my project.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: How to load data on button click rather than loading by default
« Reply #4 on: August 30, 2021, 09:36:47 pm »
Please refer to same url: https://paramquery.com/tutorial#topic-loaddata and follow case 1.

Keep dataModel.location to "local".

Send an ajax request to remote server and assign returned data to dataModel.data followed by call to refreshDataAndView.