Author Topic: grid.refreshHeader(); in tabs  (Read 2423 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
grid.refreshHeader(); in tabs
« on: January 30, 2020, 09:13:23 pm »
Trying to refresh header using jQuery tabs.

In create event for each grid after getting some data for headers

Code: [Select]
grid.refreshHeader();
Getting error on 2nd tab (first work fine)

Code: [Select]
Uncaught TypeError: Cannot read property '23' of undefined

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: grid.refreshHeader(); in tabs
« Reply #1 on: January 30, 2020, 09:35:23 pm »
Could you please share a jsfiddle.

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: grid.refreshHeader(); in tabs
« Reply #2 on: February 01, 2020, 09:01:08 pm »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: grid.refreshHeader(); in tabs
« Reply #3 on: February 03, 2020, 11:17:51 am »
It throws error because its parent div pane has style display:none

Either you can omit call to grid.refreshHeader() in inactive tabs or you can wrap the call in a try catch.

Code: [Select]
try{
      grid.refreshHeader();
}
catch(e){
       
}

https://jsfiddle.net/ka9sr02q/

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: grid.refreshHeader(); in tabs
« Reply #4 on: February 03, 2020, 02:01:40 pm »
Thanks.