Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the effect of jQuery EasyUI right-click menu grayed out and unavailable

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to achieve the jQuery EasyUI right-click menu grayed out unavailable effect, the editor feels very practical, so share with you to learn, I hope you can get something after reading this article, say no more, follow the editor to have a look.

Friends who have used EasyUI must know the background interface written by Crazy Scholars. As a beginner, I dare not comment on whether it is good or bad, but it does provide us with a good framework. As long as it is modified on its basis, it can basically meet the needs of our development.

I have known the background interface written by "Crazy Scholars" for some time, and I didn't study it until yesterday. In the course of testing, I found a place where I thought I was unfriendly. For example, when there was only one Tab tab left, click "close everything else", and then two prompt boxes popped up saying "there is no more in the back" and "there is no more in front of the end". I often use VS as a development tool, and friends who use VS will also notice that when only one page is opened, right-clicking "Close All But This" is grayed out and unavailable. I feel more human. So I tried to achieve this function. "Crazy Scholars" has added comments, so it is very convenient to study the code, and I really appreciate the work done by "Crazy Scholars" here. In the "outlook2.js" file, there is a function "tabClose ()" that clearly adds such a comment / * bind the right button to the tab * /. I am happy to see here, to achieve my function is in it.

First of all, the implementation of "all else off" is grayed out unavailable.

When only one Tab tab is open, "close all else" in the right-click menu should be grayed out and unavailable, indicating that there are no other tabs except this one. The implementation of the program is very simple, as long as you get the number of open Tab tabs, if the number is 1, then turn "all else off" to gray and unavailable.

Var tabcount = $('# tabs'). Tabs ('tabs'). The number of length; / / tab tabs if (tabcount)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report