Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/470.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用智能表搜索按钮单击事件的数据_Javascript_Angularjs_Smart Table - Fatal编程技术网

Javascript 使用智能表搜索按钮单击事件的数据

Javascript 使用智能表搜索按钮单击事件的数据,javascript,angularjs,smart-table,Javascript,Angularjs,Smart Table,我对智能桌很陌生。我已经查阅了它的文件。 但是,我还没有发现如何在智能表中绑定单击事件的数据? 代码是非常大的,但我试图把它张贴在这里 链接描述:{{backlink.SourceTitle}} 我的URL: {{backlink.SourceAnchor}} {{backlink.externallinkscont} {{backlink.internallinkscont} 不跟风 所选位置不存在反向链接。 我的js代码在这里 module.controller('backlinksc

我对智能桌很陌生。我已经查阅了它的文件。 但是,我还没有发现如何在智能表中绑定单击事件的数据? 代码是非常大的,但我试图把它张贴在这里



链接描述:{{backlink.SourceTitle}}
我的URL:
{{backlink.SourceAnchor}} {{backlink.externallinkscont} {{backlink.internallinkscont} 不跟风 所选位置不存在反向链接。
我的js代码在这里

module.controller('backlinkscocontroller'[
“$scope”、“$filter”、“mcatSharedDataService”、“globalVariables”、“backlinksService”,
函数($scope、$filter、mcatSharedDataService、globalVariables、backlinksService){
$scope.dataExistsValues=globalVariables.dataExistsValues;
变量初始化=函数(){
$scope.backlinks=未定义;
$scope.sortOrderAsc=true;
$scope.sortColumnIndex=0;
};
初始化();
$scope.itemsByPage=5;
var updateTableStartPage=函数(){
//装货前清理桌子
$scope.backlinks=[];
//在装载前结束清理工作台
updateTableData();
};
var updateTableData=函数(){
var property=mcatSharedDataService.PropertyDetails();

如果(property==undefined | | | property.Primary==null | | | property.Primary==undefined | | | property.Primary==undefined | | | property.PropertyId您可以通过进行一些简单的调整

  • 将过滤器添加到
    ng repeat
    ,并按您将在单击按钮时插入的型号进行过滤,如下所示:
  • 在您的视图中,将该模型(使用
    ng model
    )添加到输入标记并在控制器中定义它
  • 然后在单击搜索按钮时将值传递给过滤器
  • 这说明了这一点

    您可以使用
    filter:searchQuery:true
    进行严格搜索

    编辑:


    好的,OP的大问题是分页时过滤的值不会正确显示,过滤查询是从输入框中获取的,而不是使用事实上的
    st search
    插件,所以我引用了一个已经(),我已取出此解决方案,以适应有问题的用例。

    是的,你是对的,但当我们有大量记录且分页将在那里时,这将不起作用。我以前尝试过此解决方案,但分页不起作用,请检查。感谢你的即席回答。这怎么会不起作用?你不是真的在进行搜索,而是你查询您的后端,获取所有记录,对其进行筛选,并仅显示与您的模式匹配的记录。单击搜索按钮后,抓取所有“筛选”的记录并对其进行分页(而原始数据位于
    st safe src
    )我只在第一次从后端抓取数据,然后不调用数据库。我正在使用smart table it self提供的分页和排序功能。明白了,你的意思是这样的吗?是的,太神奇了!!非常感谢:)