点击查询排序

来源:互联网 发布:炒股怎么样 知乎 编辑:程序博客网 时间:2024/06/11 04:33

.controller("mode1",function($scope,$filter){


$scope.xun = "";
                $scope.namecha = function() {
               
                    /*$(function() {
                        var searchName = $("input:eq(0)").val();*/
                        //实现查询条件框内的内容为空点击查询按钮时alert提示”请输入姓名”
                        if($scope.chaxun == "" || $scope.chaxun == undefined) {
                            alert("请输入姓名");
                        } else {
                            //当搜索内容有敏感词时,alert提示
                            if($scope.chaxun == "枪" || $scope.chaxun == "法轮功") {
                                alert("输入内容含有敏感字符!");
                                $scope.chaxun = "";
                            } else {
                           
                              var arr = $filter("filter")($scope.shuzu,{"name":$scope.chaxun});
                              if(arr!= 0) {
                                   $scope.xun = $scope.chaxun;
                                    
                               } else {
                                    alert("未找到内容!");
                               }
                        }
                    }
                }

姓名查询条件<input type="text" ng-model="chaxun" id="chaxun"/>

<tr ng-repeat="s in shuzu|filter:{name:xun}|orderBy:tite:modc">

<input type="button" value="查询" ng-click="namecha()" />




$scope.paixu=function(){
var t=$scope.xuanz;
if(t=="1"){
$scope.tite="age";
$scope.modc=true;
}else if(t=="2"){
$scope.tite="age";
$scope.modc=false;
}

}





原创粉丝点击