角UI网格3 - 如何以编程方式进行排序? [英] Angular UI-Grid 3 - how to programatically sort?

查看:139
本文介绍了角UI网格3 - 如何以编程方式进行排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题说明了一切。我可以设置列,在其上进行排序,在code:

The question says it all. I can set the column, on which to sort, in code:

cols[colIdx].sort = { direction: uiGridConstants.DESC, priority: 1 };

但它实际上并不执行排序,只是把一种图标头。用户必须实际点击的列标题出现排序。做什么额外的code,我需要有那种编程发生?

But it doesn't actually perform the sort, just puts a sort icon in the header. User has to actually click on the column header for the sort to occur. What additional code do I need to have the sort happen programmatically?

在这去过好几个小时,任何想法,将大大AP preciated。
里克。

Been at this for hours, any thoughts would be greatly appreciated. Rick.

推荐答案

gridApi 您可以致电 gridApi.grid.sortColumn(列)

这篇关于角UI网格3 - 如何以编程方式进行排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆