[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Sorting grid by multiple columns in angularjs

Posted on 2016-11-07
3
Medium Priority
?
102 Views
Last Modified: 2016-11-09
Hi
I need to do Sorting grid with multiple columns in angularjs
Thanks
0
Comment
Question by:Member_2_7967608
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 41878085
<gridrow ng-repeat="row in rows | orderBy:['column1','column3','column2','column0']">
    <gridcell>{{row.column0}}</gridcell>
    <gridcell>{{row.column1}}</gridcell>
    <gridcell>{{row.column2}}</gridcell>
    <gridcell>{{row.column3}}</gridcell>
    <gridcell>{{row.column4}}</gridcell>
    <gridcell>{{row.column5}}</gridcell>
</gridrow>

Open in new window

0
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 41878268
Test page : https://jsfiddle.net/ymdbp8zt/1/

<div ng-app="myApp">
  <table ng-controller="myCtrl">
    <tr ng-repeat="row in rows | orderBy:['column1','column3','column2','column0']">
        <td>{{row.column0}}</td>
        <td>{{row.column1}}</td>
        <td>{{row.column2}}</td>
        <td>{{row.column3}}</td>
        <td>{{row.column4}}</td>
        <td>{{row.column5}}</td>
    </tr>
  </table>
</div>

Open in new window


var myApp = angular.module("myApp", []);
myApp.controller("myCtrl", ["$scope", function($scope) {
	$scope.rows = [
		{column0:"A",column1:"4",column2:"123",column3:"AZD"},  
		{column0:"A",column1:"3",column2:"124",column3:"AZC"},  
		{column0:"A",column1:"3",column2:"123",column3:"AZC"},  
		{column0:"B",column1:"0",column2:"123",column3:"AZA"},  
		{column0:"A",column1:"0",column2:"123",column3:"AZA"}  
  ];
}]);

Open in new window

0
 

Author Comment

by:Member_2_7967608
ID: 41880378
Thanks
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question