AngularJS sorting rows by table header

后端 未结 9 1929
旧巷少年郎
旧巷少年郎 2020-12-04 07:08

I have four table headers:

$scope.headers = [\"Header1\", \"Header2\", \"Header3\", \"Header4\"];

And I want to be able to sort my table by

9条回答
  •  悲哀的现实
    2020-12-04 08:03

    Here is an example that sorts by the header. This table is dynamic and changes with the JSON size.

    I was able to build a dynamic table off of some other people's examples and documentation. http://jsfiddle.net/lastlink/v7pszemn/1/

    
        
        {{header}}
      
    
    
    
        
            
                  {{cell}}
           
        
    

    Although the columns are out of order, on my .NET project they are in order.

提交回复
热议问题