• easyui 控件获取焦点方式


    针对easyui控件前端组织的dom做分析,如下:

    combo/combobox/combogrid类似结构如下:

    <input class="easyui-datebox datebox-f combo-f textbox-f" id="myid" data-options="required: true,buttons:buttons,editable:false,onSelect:selectSDate" style=" 120px; display: none;">
    <span class="textbox textbox-invalid combo datebox" style=" 120px; height: 22px;">
        <span class="textbox-addon textbox-addon-right" style="right: 0px;">
            <a href="javascript:void(0)" class="textbox-icon combo-arrow" icon-index="0" tabindex="-1" style=" 18px; height: 20px;"></a>
        </span>
        <input type="text" class="textbox-text validatebox-text textbox-prompt validatebox-invalid" autocomplete="off" readonly="readonly" placeholder="" style="margin-left: 0px; margin-right: 18px; padding-top: 1px; padding-bottom: 1px;  100px;" title="">
        <input type="hidden" class="textbox-value" name="" value="">
    </span>

    datebox类似结构如下:

    <input class="easyui-datebox datebox-f combo-f textbox-f" id="myid" data-options="buttons:buttons,editable:false,onSelect:selectEDate" style=" 120px; display: none;">
    <span class="textbox combo datebox" style=" 120px; height: 22px;">
        <span class="textbox-addon textbox-addon-right" style="right: 0px;">
            <a href="javascript:void(0)" class="textbox-icon combo-arrow" icon-index="0" tabindex="-1" style=" 18px; height: 20px;"></a>
        </span>
        <input type="text" class="textbox-text validatebox-text textbox-prompt" autocomplete="off" readonly="readonly" placeholder="" style="margin-left: 0px; margin-right: 18px; padding-top: 1px; padding-bottom: 1px;  100px;">
        <input type="hidden" class="textbox-value" name="" value="">
    </span>

    textbox,textbox多行文本类似结构如下:

    <input class="easyui-textbox textbox-f" id="myid" data-options="multiline:true,height:50" style=" 95%; display: none;">
    <span class="textbox easyui-fluid" style=" 927px; height: 50px;">
        <textarea class="textbox-text validatebox-text textbox-prompt" autocomplete="off" placeholder="" style="margin-left: 0px; margin-right: 0px; height: 48px;  925px;"></textarea>
        <input type="hidden" class="textbox-value" value="">
    </span>

    故可以使用如下获取焦点:

    $('#myid').next('span').find('.textbox-txt').focus();
  • 相关阅读:
    SICP 1.9-1.10
    SICP 1.6-1.8
    SICP 1.1-1.5
    【最小生成树】Codeforces 707B Bakery
    【数学】Codeforces 707C Pythagorean Triples
    【离线】【深搜】【树】Codeforces 707D Persistent Bookcase
    【贪心】Vijos P1615 旅行
    【字符串】【最小表示法】Vijos P1683 有根树的同构问题
    【模拟】Vijos P1005 超长数字串
    【并查集】【模拟】Codeforces 698B & 699D Fix a Tree
  • 原文地址:https://www.cnblogs.com/lcawen/p/7525381.html
Copyright © 2020-2023  润新知