easyui 回车搜索

代码:

// 搜索
    $("#searchButton").click(function() {
        var ip = $("#searchIp").val().trim();
        if (ip.length == 0) {
            ip = '';
        }
        var typeId = $('#serverType').combobox('getValue');
        var templateId = $('#template').combobox('getValue');
        loaddata(ip,typeId,templateId);
    });
    //回车搜索
    var ip = $('#searchIp');
    ip.textbox('textbox').bind('keydown', function(e){
        if (e.keyCode == 13){    
            ip.textbox('setValue', $(this).val());  //赋值
            $('#searchButton').trigger('click');
        }
    });

猜你喜欢

转载自blog.csdn.net/weixin_42402763/article/details/88948853