Author Topic: jQuery UI Tabs  (Read 3506 times)

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
jQuery UI Tabs
« on: May 31, 2017, 03:33:14 pm »
Trying to update grid in jQuery UI tabs:

Code: [Select]
$(document).ready(function() {

  $("#tabs").tabs({
  activate: function(event, ui) {
               alert("Activate event fired for " + ui.newTab);
               ui.newTab.find( ".pq-grid" ).pqGrid( "refresh" );
}
  });
});

1. ui.newTab is rendered as empty object?
2. Get error on ui.newPanel.find( ".pq-grid" ).pqGrid( "refresh" ), Uncaught TypeError: ui.newTab.find(...).pqGrid is not a function

Thanks in advance.
« Last Edit: May 31, 2017, 03:48:33 pm by queensgambit9 »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: jQuery UI Tabs
« Reply #1 on: May 31, 2017, 05:54:13 pm »
It's ui.newPanel.find(".pq-grid").pqGrid("refresh"); inside activate event.

Example: https://paramquery.com/pro/demos/detail

Please share a test case if you face any issue.

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: jQuery UI Tabs
« Reply #2 on: June 01, 2017, 01:13:54 pm »
http://jsfiddle.net/87q70av9/1/

In Tab #2 I would like to a load a pqGrid page...btw is there an easy way to host a sample external file in jsfiddle or similiar?

Thanks.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: jQuery UI Tabs
« Reply #3 on: June 01, 2017, 05:48:23 pm »
you need to have predefined grids in the tabs.

activate event is used only to refresh the view of grids.

http://jsfiddle.net/87q70av9/2/

queensgambit9

  • Pro Ultimate
  • Sr. Member
  • *
  • Posts: 341
    • View Profile
Re: jQuery UI Tabs
« Reply #4 on: June 01, 2017, 05:56:21 pm »
Thanks, I have 2 grids on separate html pages and would like to have them collected on a tabs page.
Thats not possible?
« Last Edit: June 01, 2017, 07:12:48 pm by queensgambit9 »