zoukankan      html  css  js  c++  java
  • easy ui tabs 顶部绑定事件

    $(function(){
         $('#tb').tabs('bindclick', function(index, title){
         });
     });

    $.extend($.fn.tabs.methods, {
     bindclick : function(jq, caller) {
      return jq.each(function() {
       var that = this;
       $(this).children("div.tabs-header").find("ul.tabs").undelegate(
         'li', 'click.tabs').delegate(
         'li',
         'click.tabs',
         function(e) {
          if (caller && typeof (caller) == 'function') {
           var title = $(this).text();
           var index = $(that).tabs('getTabIndex',
             $(that).tabs('getTab', title));
           caller(index, title);
           if (title == "修改密码") {
            $("#sopwd")[0].focus();
           } else if (title == "个人信息") {
            // 获得光标
            $("#aname")[0].focus();
            var input = $("#aname")[0];
            var val = input.value;
            input.value = "";
            input.value = val;
           }
          }
         });
      });
     }
    });

    <div id="tb" class="easyui-tabs" border=false>
     <!--修改个人信息--开始  -->
      <div title="个人信息" class="selftitle">
       <form id="formupduser">
        <div style="display: none">
         <input type="hidden" id="aname1" value="${user.aname}"  />
         <input type="text" id="email1" value="${user.email}" />
         <input type="hidden" id="phone1" value="${user.phone}" />
         <input type="hidden" id="mobilephone1" value="${user.mobilephone}"  />
        </div>
        <ul class="selffon">
         <li id="xinxiweihu" style="">
          <span  class="l-btn-text l-btn-icon-left" style="background-image:
           url('<%=JToolType.jsppath%>/jquery-easyui-1.3.3/themes/icons/sum.png');">
            个人信息维护
           </span>
         </li>
         <li><span id="margin-left50"></span>类 型:
         <span>
          <c:choose>
              <c:when test="${user.issa}">   
                超级管理员
              </c:when>
              <c:otherwise> 
               普通用户
                    </c:otherwise>
                       </c:choose>
           </span>
         </li>
         <li><span id="margin-left50"></span>用户名:<input type="text" id="aname" name="aname" value="${user.aname}"  /> </li>
         <li><span id="margin-left50"></span>邮 箱:<input type="text" id="email" name="email" value="${user.email}"/> </li>
         <li><span id="margin-left50"></span>固 话:<input type="text" id="phone" name="phone"  value="${user.phone}"  /> </li>
         <li><span id="margin-left50"></span>手 机:<input type="text" id="mobilephone" name="mobilephone" value="${user.mobilephone}"  /> </li>
         <li>
          <span id="margin-left70"></span> <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" plain="false" href="javascript:updateuser()">保存</a>
           <a class="easyui-linkbutton" data-options="iconCls:'icon-reload'" plain="false" href="javascript:setforminputblack('formupduser');" >清空</a>
         </li>
        </ul>
       </form>
      </div>
    <!-- 修改个人信息结束 -->

    <!-- 修改密码开始 -->
      <div title="修改密码" class="selftitle"    >
       <form  id="formupdpwd" data-options="onclick:'javascript:alert();'">
        <ul class="selffon">
         <li class="passwordweihu" >
         <span class="l-btn-text  l-btn-icon-left" style=" background-image: url('<%=JToolType.jsppath%>/jquery-easyui-1.3.3/themes/icons/sum.png');">
            个人密码维护
          </span>
         </li>
         <li><span id="margin-left50"></span>原始密码:<input type="password" id="sopwd" /></li>
         <li><span id="margin-left50"></span>新的密码:<input type="password" id="newpwd" /></li>
         <li><span id="margin-left50"></span>确认密码:<input type="password" id="confirmpwd" /></li>
         <li>
              <span id="margin-left70"></span>
           <a href="javascript:updateuserpwd()" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" plain="false">保存</a>
           <a href="javascript:setforminputblack('formupdpwd');" class="easyui-linkbutton" data-options="iconCls:'icon-reload'" plain="false">清空</a>
          </li>
        </ul>
       </form>
      </div>
      <!-- 修改密码结束 -->

  • 相关阅读:
    用python自定义实现db2的连接池
    python写的爬虫工具,抓取行政村的信息并写入到hbase里
    201521123119《Java程序设计》第4周学习总结
    201521123119《Java程序设计》第5周学习总结
    201521123119《Java程序设计》第6周学习总结
    201521123119《Java程序设计》第1周学习总结
    log4j:WARN No appenders could be found for logger
    android 单元测试
    android手机屏幕适配2
    android手机屏幕适配
  • 原文地址:https://www.cnblogs.com/xiaotao123/p/3388434.html
Copyright © 2011-2022 走看看