Author Topic: Grid data is not updating on change of new data  (Read 1612 times)

vinay.narasapurapu

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 7
    • View Profile
Grid data is not updating on change of new data
« on: September 08, 2020, 05:56:41 pm »
Hi,

I am using react verion where i am trying to feed data by external search. i cant see the new data on grid.

public componentDidUpdate(previousProps, previousState) {

    if (JSON.stringify(previousProps.Data) !== JSON.stringify(this.props.Data)) {   
     
      CurrentClass.pqGridObj.data = this.props.Data; //CurrentClass.pqGridObj.options.dataModel.data = this.props.Data;
      CurrentClass.pqGridObj.refreshDataAndView();
    }
  }
« Last Edit: September 08, 2020, 06:04:01 pm by vinay.narasapurapu »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Grid data is not updating on change of new data
« Reply #1 on: September 08, 2020, 07:09:41 pm »
Please follow this react example on updating grid data:

https://stackblitz.com/edit/paramquery-react-switch-data

Kindly share a test case via stackblitz if you still face any issues.

vinay.narasapurapu

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Grid data is not updating on change of new data
« Reply #2 on: September 08, 2020, 07:44:18 pm »
Thank you it resolved the issue