EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: ellisgl on July 24, 2011, 06:51:06 PM



Title: close tab?
Post by: ellisgl on July 24, 2011, 06:51:06 PM
I want to make a button that is in the content part of a tab to close the tab. I looked at the docs, but could for the life of me figure out. Help?


Title: Re: close tab?
Post by: ellisgl on July 27, 2011, 08:50:05 PM
Never mind - figured it out - with my own plugin for id based tabs. =)


Title: Re: close tab?
Post by: tslatt on November 28, 2011, 12:42:14 PM
Could you share that code?


Title: Re: close tab?
Post by: ellisgl on November 28, 2011, 01:23:03 PM
http://pastebin.com/j3VZ1eT0


Title: Re: close tab?
Post by: tslatt on November 28, 2011, 02:48:10 PM
Thanks!


Title: Re: close tab?
Post by: tslatt on November 29, 2011, 09:34:20 AM
I tried to implement the code, but I'm unclear on the usage so I couldn't get it working. Can you provide an example of how you're using it? I really need to be able to give tabs ids to identify them, rather than titles.

In my case, each tab will hold a person's information, and the title of the tab will be that person's name. However, two people might have the same name (but of course, different information). So I need a unique identifier for each tab to use when selecting that tab and performing actions on that tab.

Thank you so much for your help!


Title: Re: close tab?
Post by: tslatt on December 06, 2011, 03:54:29 PM
I found a solution (hack) to using titles instead of unique ids. I include a unique identifier within the tab title surrounded by a <strong> tag that has a style of display: none.

Example Titles: "John Smith<strong>ID0123456<\/strong>" and "John Smith<strong>ID7890123<\/strong>".

The css: .tabs li a.tabs-inner strong { display: none; }