Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/webapp/js/lib/angular-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ angular.module('angular-table', [])
compile: function (tElement, tAttrs) {
SortState.sortExpression = tAttrs.defaultSortColumn;
TemplateStaticState.instrumentationEnabled = tAttrs.instrumentationEnabled;
TemplateStaticState.modelName = tAttrs.model;

// find whatever classes were passed into the angular-table, and merge them with the built in classes for the container div
tElement.addClass('angularTableContainer');
Expand All @@ -18,8 +19,9 @@ angular.module('angular-table', [])
tElement.replaceWith(rowTemplate);

// return linking function
return function(scope) {
return function(scope, elem, attrs) {
scope.parent = scope.$parent;

};
},
scope: {
Expand Down Expand Up @@ -316,7 +318,7 @@ angular.module('angular-table', [])

// add the ng-repeat and row selection click handler to each row
rowTemplate = rowTemplate.replace('<tr',
'<tr ng-repeat="row in model | orderBy:SortState.sortExpression:SortState.sortDirectionToColumnMap[SortState.sortExpression] | filter:filterQueryModel" ' +
'<tr ng-repeat="row in ' + TemplateStaticState.modelName + ' | orderBy:SortState.sortExpression:SortState.sortDirectionToColumnMap[SortState.sortExpression] | filter:filterQueryModel" ' +
selectedBackgroundColor + ngClick);
}

Expand Down Expand Up @@ -365,6 +367,7 @@ angular.module('angular-table', [])
self.selectedRowColor = '';
self.evenRowColor = '';
self.oddRowColor = '';
self.modelName = '';

return self;
})
Expand Down