Angularjs ui-grid sorting table according to a given column name -
i using ui-grid version v3.0.0-rc.21-1d9f81f - 2015-05-01 , trying sort given grid according given column name. cannot sort externally (from javascript code), defining , clicking on grid's headers.
is possible in version sort grid's data according grid's column name via javascript code?
if want sort based on column/field before grid loaded, can using angular orderby filter whenever data retrieved server.
$filter('orderby')(array, expression, reverse)
or if wanted sort grid @ initial state, can define in columndef sort property
{ field: 'gender', sort: { direction: uigridconstants.asc, priority: 0, } }
take @ plnkr http://plnkr.co/edit/4qqgi76rqpyxbrgbcbyx?p=preview
Comments
Post a Comment