javascript 在angularjs中拖放以排列表格行顺序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27978478/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Drag and drop to arrange table row order in angularjs
提问by raju
I am using angularjs and have a simple table. I use the following code
我正在使用 angularjs 并有一个简单的表格。我使用以下代码
<table id="searchObjResults">
<tr><th>Name</th><th>Phone</th></tr>
<tr ng-repeat="friendObj in friends | filter:search:strict">
<td>{{friendObj.name}}</td>
<td>{{friendObj.phone}}</td>
</tr>
</table>
Is there any simple way through which user can arrange the rows in list. User actually wants to take printout of the table and want the rows ordered in required fashion in printed paper.
有什么简单的方法可以让用户在列表中排列行。用户实际上想要打印出表格,并希望在打印纸中以所需的方式排列行。
回答by Janaki Sathiyamurthy
Either you can define your own directive or go for some third party plugins which are discussed in below link,
您可以定义自己的指令,也可以使用下面链接中讨论的一些第三方插件,