关闭

JQuery插件第三十三个:高级搜索下的排序功能

474人阅读 评论(0) 收藏 举报
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>无标题页</title>
    <script type="text/javascript" src="../jquery-1.6.js"></script>
</head>
<body><input id="ddd" type="hidden" value="10258" />
    <table border="0" cellpadding="0" cellspacing="0">
        <tr class="ser">
            <td width="9%" style="text-align: right;" class="search">
                <span style="text-align: right;">:</span>
            </td>
            <td width="12%">
                <input name="SN" id="SN" type="text" class="sousuo" />
            </td>
            <td width="10%" style="text-align: right;">
                <input name="Startdate" id="Startdate" type="text" class="sousuo2" />
                —
            </td>
            <td width="9%">
                <input name="Enddate" id="Enddate" type="text" class="sousuo2" />
            </td>
            <td width="7%" style="text-align: right;" class="hidfeild">
                加工厂:
            </td>
            <td width="14%" class='hidfeild'>
            </td>
            <td width="5%" style="text-align: right;">
                 <span id="checkerspan">审核人:</span>
            </td>
            <td width="11%" id="checkerddl">
            </td>
            <td width="10%">
                 
            </td>
            <td width="8%">
                 
            </td>
            <td width="8%">
                 
            </td>
            <td width="14%" class='hidcol'>
                 
            </td>
            <td class='hidcol'>
                 
            </td>
        </tr>
        <tr class="ser">
            <td style="text-align: right; padding: 10px 0;">
            </td>
            <td>
            </td>
            <td style="text-align: right;">
                <input name="checkStartdate" id="checkStartdate" type="text" value="审核开始日期" class="sousuo2" />
                —
            </td>
            <td>
                <input name="checkEnddate" id="checkEnddate" type="text" value="审核结束日期" class="sousuo2" />
            </td>
            <td style="text-align: right;" class="hidfeild">
                 <span id="perspan">收货人:</span>
            </td>
            <td class='hidfeild' id="perddl">
                <select name="per" id="per" class="dropdownlist">
                    <option>ff </option>
                    <option>ee</option>
                </select>
            </td>
            <td align="right">
                 
            </td>
            <td>
            <a id="btn1"  >搜索</a>
            </td>
            <td align="right">
            </td>
            <td>
                 
            </td>
            <td>
                 
            </td>
            <td class='hidcol'>
                 
            </td>
            <td class='hidcol'>
                <input id="Button1" type="button" value="button" />
                <script src="jquery.cookie.js" type="text/javascript"></script>
                <script src="jquery.setTip.js" type="text/javascript"></script>
                <script src="jQuery.urlParam.js" type="text/javascript"></script>
                <script src="jQuery.keyValue.js" type="text/javascript"></script>
                <script src="jQuery.AdvSearch.js" type="text/javascript"></script>
                <script src="jQuery.orderBySearch.js" type="text/javascript"></script>
                <script language="javascript" type="text/javascript">
                    $(".ser").AdvSearch({
                        searchbtn: "#btn1",
                        otherUrl: "&ddd=1&ss=1"
                    });    
                    $("#Button1").data({"ddd":123456});
                    $("#Button1").orderBySearch();   
                </script>
            </td>
        </tr>
    </table>
</body>
</html>

(function ($) { 
  $.fn.orderBySearch = function(options){
      var defaults = {
        searchArea:".ser",
        searchbtn: "#btn1",
        otherUrl: "&ddd=1&ss=1",
        param:"ddd"
      }
      var opts = $.extend(defaults, options);
		//主要执行过程		        
	  this.each(function(){
            var $obj=$(this);
            $obj.click(function(){
                var btn=$(opts.searchbtn);
                btn.unbind();
                with($.keyValue){
                    str=opts.otherUrl;
                    firstChar="&";
                    secondChar="=";
                }
                opts.otherUrl=$.keyValue.set(opts.param,$obj.data(opts.param));
                $(opts.searchArea).AdvSearch({
                    searchbtn: opts.searchbtn,
                    otherUrl: opts.otherUrl
                });
                btn.trigger("click");
            });
	  });			
  };
})(jQuery);

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:189081次
    • 积分:2819
    • 等级:
    • 排名:第12718名
    • 原创:81篇
    • 转载:114篇
    • 译文:1篇
    • 评论:25条
    最新评论