First off great work!! You've included a lot of nice features. I'm having an issue with working with nested json content. I've tried different ways to apply filtering and sorting on columns that are being populated with nested content. For example, this is my json string...
First level key/value pairs work just fine when filtering and sorting. However I'm not able to figure out the correct syntax when dealing with second and third level pairs. Here is my html...
/* Load Active Assignments Table */
Staffing.getActiveAssignments(function(data) {
$scope.activeAssignmentsArray = data;
$scope.assignmentsTableParams = new ngTableParams({
page: 1, // show first page
count: 10
}, {
total: data.length, // length of data
getData: function($defer, params) {
// filter sorting
var orderedData = params.sorting() ?
$filter('orderBy')(data, params.orderBy()) :
data;
// use build-in angular filter and filter search
var orderedData = params.filter() ?
$filter('filter')(orderedData, params.filter()) :
orderedData;
$scope.activeAssignmentsArray = orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count());
params.total(orderedData.length); // set total for recalc pagination
$defer.resolve($scope.activeAssignmentsArray);
}
});
});
As noted, the first four columns are on the first level of the json feed and work just fine with filtering and sorting. The problem is the second and third level content. Can you tell me if it's possible to filter sub level content and if so how would I go about this? Thanks in advance and good work.
Hi,
First off great work!! You've included a lot of nice features. I'm having an issue with working with nested json content. I've tried different ways to apply filtering and sorting on columns that are being populated with nested content. For example, this is my json string...
First level key/value pairs work just fine when filtering and sorting. However I'm not able to figure out the correct syntax when dealing with second and third level pairs. Here is my html...
Here is my JavaScript snippet...
As noted, the first four columns are on the first level of the json feed and work just fine with filtering and sorting. The problem is the second and third level content. Can you tell me if it's possible to filter sub level content and if so how would I go about this? Thanks in advance and good work.