EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: chriseana on November 06, 2017, 06:10:24 AM



Title: Window with two tabs [SOLVED]
Post by: chriseana on November 06, 2017, 06:10:24 AM
I have a Treeview with a onclick event that shows a window that loads an specific HTML page:
Code:
  /* On Click Function */
$('#tt').tree({
onClick: function(node){

if (node.url == "" || node.url == null) {
} else {
/* Open a Window to show data */
$('#win').window({
          width:880,
          height:500,
          modal:true
         });
/* load window content from disk */
        $('#win').window('refresh', node.url);

/* Define window properties */
$('#win').window({
cls:'c7',
title: 'Dados',
border:'thin',
collapsible: false,
minimizable: false,
maximizable: true,
closable: true
});

/* alert(node.url);  // alert node text property when clicked */
  }
}
});


Now, I need to open this same window but with two TABs, each loading a specific HTML page.

How can I do this using Javascript?


Title: Re: Window with two tabs
Post by: stworthy on November 07, 2017, 02:26:09 AM
In your 'onClick' event, open the window component and load its content.
Code:
onClick: function(node){
var url = node.url;
$('#win').window('open').window('refresh', url)
}

The window component looks like this:
Code:
<div id="win" class="easyui-window" closed="true" style="width:600px;height:300px">
</div>

And the content page looks like this:
Code:
<div class="easyui-tabs" fit="true">
<div title="Tab1"></div>
<div title="Tab2"></div>
</div>


Title: Re: Window with two tabs [SOLVED]
Post by: chriseana on November 07, 2017, 10:00:06 AM
Thank you,
It's working now.
It's so easy, but I was stuck in another paradigm.

Best regards