EasyUI Forum
May 07, 2024, 01:16:25 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Initialising the href loading of subtab1 in a set of nested tabs  (Read 7378 times)
andyj
Jr. Member
**
Posts: 57



View Profile
« on: August 09, 2013, 05:22:52 AM »

I have a set of parent tabs and one of these tabs in turn contains a nested set of subtabs.
Each of the subtabs dynamically loads remote content using the href property.
Each of these nested tabs contains a datagrid or a form, which are actually child tables of the master record.
I successfully pass the master record id to these grids or forms, which use it as part of their select query.
All works fine except that the first subtab fails to initially load its form data.
There isn't a problem with the form as if you try moving it to another tab position it works fine.
If you set the first subtab with "cache:false", then subsequent clicking on the tab successfully loads the form data.

Is it possible to force the first subtab to refresh when the page first loads as follows:

The first subtab in the nested tabs:
Code:
<div title="Qualifications" data-options="id:'tab_qualifications',cache:false,href:'qualifications/qualifications.php'" style="padding:5px"></div>

JS document load (doesn't work though):
Code:
$(function(){
$('#mainform').form('load','data_select.php?entity_id='+'<?php echo $_GET['entity_id'];?>');
$('#tab_qualifications').panel('refresh'); //This doesn't work...
});


How can I refresh this first subtab and keep "cache:true" as I want the form to keep its state when traversing other tabs?
Thanks for your ideas...
« Last Edit: August 09, 2013, 07:21:40 AM by andyj » Logged
andyj
Jr. Member
**
Posts: 57



View Profile
« Reply #1 on: August 09, 2013, 11:14:06 AM »

Found a not ideal workaround by triggering a refresh from the master tab set:

Code:
<div class="easyui-tabs" data-options="id:'master-tabs',fit:true,border:false,plain:true"  onclick="javascript:$('#tab_qualifications').panel('refresh');">

"tab_qualifications" here is the id of the first subtab div I needed to refresh:
Code:
<div title="Qualifications" data-options="id:'tab_qualifications',href:'qualifications/qualifications.php'" style="padding:5px"></div>

What would be best is to have a way of forcing the panel to refresh just upon loading the page otherwise this subtab is reloaded everytime you click on a master tab. Anyone got any neat solution?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!