Home > Web Front-end > JS Tutorial > body text

Summary of EasyUI usage tips in jquery_jquery

WBOY
Release: 2016-05-16 16:14:59
Original
1215 people have browsed it

combobox component

1. Disable the input box in combobox

Copy code The code is as follows:

$("selector").combo('textbox').attr("readonly", "readonly");
$('selector').combobox({
editable:false ,
panelheight:300
});

2. Disabled

Copy code The code is as follows:

​$('selector').combobox('disable');

3. Get option text and value

Copy code The code is as follows:

$("selector").combobox("getText")//Get option text
$("selector").combobox("getValue")//Get option value

4. Focus automatically expands, press Enter to do someting

Copy code The code is as follows:

$("selector").focus(function () {
$(this).combo('showPanel');
$(this).combo('textbox').focus();
$($(this).combo('textbox')).unbind("keyup").bind("keyup", function (e) {
If (e.keyCode == 13) {

//do someting
}
});
});

2. When the pop-up layer pops up, the first button has focus by default. Press the Enter key to execute the corresponding function and then close it. However, it is not available after using webbrowser to display it in the cs program.

So we have the following method to monitor the body keyup event. The difference is that the click event can be triggered whether the button has focus or not, which is more like a modal window. (This method will close if you press Enter in the pop-up window, which is not advisable)

Copy code The code is as follows:

$('body').live('keyup',function(e){
If(e.keyCode == 13){
           $('.window').map(function(){
If($(this).css('display') == 'block'){
                  $(this).find('.messager-button').children("a:first").click();
                  $(this).find('.dialog-button').children("a:first").click();
            }
        });
}
});

Note: I saw many netizens writing related articles and also used it. I felt like I was on a pirate ship. It was so slow. When the page is loading, it is completely white for about two seconds (it is just a reference to the library file), so the performance should be okay for so many people. I hope Daniel can give me some advice.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template