I am new to angular JS. Working on ng-grid.the table contains variable data rows. i.e the grid can have 10 rows or 27 rows or even greater than that. I am currently defining the column defs as follows
$scope.gridOptions = {
data: 'evnts',
enableColumnResize: false,
enableRowSelection: false,
enableCellSelection: false,
enableSorting:true,
multiSelect: false,
showFilter: false,
showColumnMenu: false,
plugins: [new ngGridFlexibleHeightPlugin()],
selectedItems: $scope.selectedRows,
//For Impact Column
//filterOptions: {filterText: '', useExternalFilter: false},
afterSelectionChange: function(data) {
row = $scope.selectedRows[0]
if (!row) {return;}
selectedRowFactory.row = row
$location.path('/event/'+row.id)
},
columnDefs: [
{field:'rl', displayName:'Importance',sortFn:impSortFn,width:'80px'},
{field:'dt', displayName:'Time', width:'57px', cellFilter:'date:\"HH:mm:ss\"',headerClass:'grad1',cellTemplate:'<div class="text-center">{{row.getProperty(\'dt\')|timefilter}}</div>'},
{field:'fl', sortable:true, displayName:'Country',width:'60px',
cellTemplate:'<div class="ngCellText text-center" ng-class="col.colIndex()"><span ng-cell-text><img class="flag" src="img/Country_Images/{{row.getProperty(col.field)}}"></img></span></div>',
width: '80px',headerClass:'grad1'},
{field:'ev', displayName:'Event', width:'******',headerClass:'grad1'},
]
Index.html
<div class="view" data-ng-view></div>
is there an option to limit the contents of ng grid to top 10? I have gone through the limitTo
functionality but don't know if the same functionality is available in defining the grid options. Please help.
Thanks in advance.