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>
  <!-- 修改密码结束 -->

posted @ 2013-10-25 18:56  tao5310  阅读(809)  评论(0编辑  收藏  举报