EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
November 30, 2025, 04:40:53 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
[Solved]Reorder Tabs from Code
Pages: [
1
]
« previous
next »
Print
Author
Topic: [Solved]Reorder Tabs from Code (Read 9779 times)
MSAG
Newbie
Posts: 41
[Solved]Reorder Tabs from Code
«
on:
January 12, 2019, 07:39:34 AM »
Hi
As doc of insert tab in special location we must use index to set like this:
// add a unselected tab panel
$('#tt').tabs('add',{
title: 'new tab',
selected: false
//...
});
// insert a tab panel to the index 2
$('#tt').tabs('add',{
title: 'inserted tab',
index: 2
})
but what about if we just want to reorder old tab without lose content of its
i tried to use update like this:
oldtab.panel("options").index =newIndex;
$('#tt').tabs('update', { tab: oldtab, index: newIndex, options: oldtab.panel("options"), type: "header" });
but that is not work
and then i tried to add more this code:
$(oldtab.panel('options').tab).parent().append(oldtab.panel('options').tab);
it is work to move tab to first location
and i use it to push all tabs as i wont
my problem is:
when i click on tabs it go to panel of old tab index (show me the panel for old index not the new)
how can i fix it
thanks a lot
«
Last Edit: January 14, 2019, 07:37:04 PM by MSAG
»
Logged
MSAG
Newbie
Posts: 41
Re: Reorder Tabs from Code
«
Reply #1 on:
January 13, 2019, 10:11:45 AM »
Full my code of update to reorder tabs:
here code of sort my list LLogindTabInfo
then:
for (i = 0; i < LLogindTabInfo.length; i++) {
if (dg.tabs('exists', LLogindTabInfo
.Title)) {
var tab = dg.tabs('getTab', LLogindTabInfo
.Title);
if (!tab.panel('options').href)
dg.tabs('update', { tab: tab, index: i, options: { href: LLogindTabInfo
.Url } });
else {
tab.panel('options').index = i;
dg.tabs('update', { tab: tab, index: i, options: tab.panel("options"), type: "header" });
}
}
tab.panel('options').index = i;
$(tab.panel('options').tab).parent().append(tab.panel('options').tab);
}
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: Reorder Tabs from Code
«
Reply #2 on:
January 14, 2019, 06:07:22 PM »
The 'move' method is available from the tabs extension
https://www.jeasyui.com/extension/downloads/tabs-dnd.zip
. Call the 'move' method to reorder the tab panels.
Code:
var tab = $('#tt').tabs('getSelected');
$('#tt').tabs('move', {
tab: tab,
index: 2
})
Logged
MSAG
Newbie
Posts: 41
Re: [Solved]Reorder Tabs from Code
«
Reply #3 on:
January 14, 2019, 07:37:57 PM »
It's work thank you very much Mr. stworthy
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...