JQuery easyui Tabs extension opens the page sign based on custom properties _jquery

Source: Internet
Author: User

Easyui is a lightweight background management system framework, a variety of components are available, easy to use, now has a free version of the license.

1. Increase the expansion

<script type= "Text/javascript" >
/**
* @author {KEXB} easyui-tab extension is based on the ID switch page
/$.extend ($. Fn.tabs.methods, {
gettabbyid:function (JQ, id) {
var tabs = $.data (jq[0), ' tabs '). Tabs;
for (var i = 0; i < tabs.length i++) {
var tab = tabs[i];
if (Tab.panel (' Options '). id = = ID) {return
tab;
}}
return null;
},
selectbyid:function (JQ, id) {
var tab;
var tabs = $.data (jq[0], ' tabs '). Tabs;
for (var i = 0; i < tabs.length i++) {
tab = tabs[i];
if (Tab.panel (' Options '). id = = ID) {break
;
}
}
if (tab!= undefined) {
var curtabindex = $ ("#tabs"). Tabs ("Gettabindex", tab);
$ (' #tabs '). Tabs (' select ', Curtabindex);
}
,
existsbyid:function (JQ, id) {return
jq.tabs (' Gettabbyid ', id)!= null;
}
};
</script>

2. Click event Open method

function Open (text, URL, id) {
var tabid = replaceall (URL, '/', ');
var h = computgridheight ();
if (url = = "null" | | | url = = "" | | url = = "") {return
;
}
if ($ ("#tabs"). Tabs ("Existsbyid", TabID)) {
$ ("#tabs"). Tabs ("Selectbyid", tabid);
}
else
{
if (Url.indexof ("?") < 0) {
url = "? _menuid=" + ID;
}
else {
URL = = "&_menuid=" + ID;
}
$ (' #tabs '). Tabs (' Add ', {
id:tabid,
title:text,
closable:true,
content:createtabcontent (URL, h),
Url:url
});
}

The above is a small set to introduce the jquery easyui tabs extension based on custom properties to open the page sign, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.