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="width: 120px; display: none;">
<span class="textbox textbox-invalid combo datebox" style="width: 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="width: 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; width: 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="width: 120px; display: none;">
<span class="textbox combo datebox" style="width: 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="width: 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; width: 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="width: 95%; display: none;">
<span class="textbox easyui-fluid" style="width: 927px; height: 50px;">
    <textarea class="textbox-text validatebox-text textbox-prompt" autocomplete="off" placeholder="" style="margin-left: 0px; margin-right: 0px; height: 48px; width: 925px;"></textarea>
    <input type="hidden" class="textbox-value" value="">
</span>

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

$('#myid').next('span').find('.textbox-txt').focus();

 

转载于:https://www.cnblogs.com/lcawen/p/7525381.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值