Author Topic: how to reset data  (Read 2179 times)

徐雪峰

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 48
    • View Profile
how to reset data
« on: July 17, 2020, 09:18:27 am »
i get new json data ,and i want to set the new json data to grid.
i don't know how do it?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: how to reset data
« Reply #1 on: July 17, 2020, 10:25:04 am »
It's done by resetting dataModel.data option followed by call to refreshDataAndView

Code: [Select]
  grid.option( 'dataModel.data', new_json_data );
  grid.refreshDataAndView();

徐雪峰

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: how to reset data
« Reply #2 on: July 17, 2020, 02:39:05 pm »
but my pivot grid didn't show the colGroup on the right way.

徐雪峰

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: how to reset data
« Reply #3 on: July 18, 2020, 08:11:52 am »
i can't refresh the pivot group when my json data changed. but i refreshed the pivot grid by myself js method.