Author Topic: Reload tab  (Read 887 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 302
    • View Profile
Reload tab
« on: February 14, 2020, 03:47:13 pm »
Trying to reload active tab when clicking on title in grid...use onclick in title definition or is there a better way?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4750
    • View Profile
Re: Reload tab
« Reply #1 on: February 14, 2020, 09:34:31 pm »
[ Only Pro members may read this post. ]
« Last Edit: February 14, 2020, 09:37:05 pm by paramvir »

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 302
    • View Profile
Re: Reload tab
« Reply #2 on: February 25, 2020, 03:21:01 pm »
Using jQuery tabs and on each tab the title is clickable. When the user clicks the title I would like to reload grid in that tab (stay in the tab but grid is reloaded).

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4750
    • View Profile
Re: Reload tab
« Reply #3 on: February 25, 2020, 03:56:59 pm »
[ Only Pro members may read this post. ]
« Last Edit: February 25, 2020, 04:02:13 pm by paramvir »

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 302
    • View Profile
Re: Reload tab
« Reply #4 on: February 25, 2020, 06:35:42 pm »
It is the grid title and not the tab title. Sorry for being unclear.

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 302
    • View Profile
Re: Reload tab
« Reply #5 on: February 26, 2020, 03:30:52 pm »
Ex:

Code: [Select]
title: "<a href='index.php#tab1'>test</a>"
But that doesn't seem to work...

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4750
    • View Profile
Re: Reload tab
« Reply #6 on: February 26, 2020, 03:56:21 pm »
[ Only Pro members may read this post. ]

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 302
    • View Profile
Re: Reload tab
« Reply #7 on: February 26, 2020, 05:34:31 pm »
Thanks, using:

Code: [Select]
create: function() {
 
    $( '#grid1' ).find(".pq-grid-title").click(function(){
$(this).closest(".pq-grid").pqGrid('refreshDataAndView');
})...

Do not work as I would like it to...grid in current tab should reloaded to its initial state...with above code columns are not restored, filters not removed etc.
Is it correct to use it in create event?
« Last Edit: February 26, 2020, 05:52:22 pm by queensgambit9 »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4750
    • View Profile
Re: Reload tab
« Reply #8 on: February 27, 2020, 10:26:10 am »
[ Only Pro members may read this post. ]

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 302
    • View Profile
Re: Reload tab
« Reply #9 on: February 27, 2020, 03:28:25 pm »
https://jsfiddle.net/queensgambit9/g4h0mory/12/

When I click grid title 'test' in Tab 1 I would like to load a state called 'test'.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4750
    • View Profile
Re: Reload tab
« Reply #10 on: February 27, 2020, 08:43:55 pm »
[ Only Pro members may read this post. ]

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 302
    • View Profile
Re: Reload tab
« Reply #11 on: February 28, 2020, 01:52:53 pm »
Thank you, works fine.