【发布时间】:2015-01-26 07:14:55
【问题描述】:
【问题讨论】:
-
你可以有你喜欢的标题..看例子18
-
谢谢。我希望继续使用 ng-table 生成的输入。但我可以在这里看到如何使用另一个
<input>作为过滤器模型:jitendrazaa.com/blog/webtech/web/…
【问题讨论】:
<input> 作为过滤器模型:jitendrazaa.com/blog/webtech/web/…
添加新的解决方案 在 ng-table html 中,做这样的事情,
<td filter="{ address: {id:'text',placeholder:'ADDRESS'}}">{{row.address}}</td>
【讨论】:
为避免编辑 ng-table.js 文件,您可以添加以下内容:
angular.module('ngTable').run(['$templateCache', function ($templateCache) {
$templateCache.put('ng-table/filters/text.html', '<input type="text" ng-model="params.filter()[name]" ng-if="filter==\'text\'" placeholder="{{name}}" class="input-filter form-control"/>');
}]);
这将创建 ng-tables 'text' filter 'ng-table/filters/text.html' 中使用的模板的缓存副本。
【讨论】:
你可以编辑 ng-table.js
Unminify ng-table.js (ie: http://jsbeautifier.org/) 然后在第 250 行你可以找到
<input type="text" ng-model="params.filter()[name]" ng-if="filter==\'text\'" ,class="input-filter form-control"/>
在此处添加占位符,即:
<input type="text" ng-model="params.filter()[name]" ng-if="filter==\'text\'" placeholder="input {{name}}",class="input-filter form-control"/>
请在此处查看工作演示:
【讨论】: