forked from angular-ui/ui-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain4.js
38 lines (32 loc) · 1.46 KB
/
main4.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function userController($scope) {
$scope.myDefs = [{ field: 'Vendor', displayName: 'Supplier', cellTemplate: '<button ng-click="switchUser(row.entity)">test</button>' },
{ field: 'SeasonCode', displayName: 'My SeasonCode' },
{ field: 'Mfg_Id', displayName: 'Manufacturer ID' },
{ field: 'UPC', displayName: 'Bar Code' }];
$scope.selections = [];
$scope.switchUser = function(row){
console.log(row);
row.updated = true;
};
$scope.gridOptions = {
data: 'myData',
selectedItems: $scope.selections,
enableRowSelection: true,
multiSelect: false,
enableRowReordering: false,
showGroupPanel: true,
columnDefs: 'myDefs',
showColumnMenu: true,
enableColumnReordering: true,
enableColumnResize:true,
showFooter: true,
showFilter: true,
filterOptions: {filterText:'573', useExternalFilter: false}
};
$scope.myData = [{ 'Sku': 'C-', 'Vendor': 'NEWB', 'SeasonCode': false, 'Mfg_Id': '573-', 'UPC': '' },
{ 'Sku': 'J-', 'Vendor': 'NIKE', 'SeasonCode': false, 'Mfg_Id': '-', 'UPC': '' },
{ 'Sku': 'K-', 'Vendor': 'REEB', 'SeasonCode': true, 'Mfg_Id': '355-', 'UPC': '' },
{ 'Sku': 'J-', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '-8855467', 'UPC': '' },
{ 'Sku': 'K-', 'Vendor': 'REEB', 'SeasonCode': true, 'Mfg_Id': '355-', 'UPC': '' },
{ 'Sku': 'J-', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '-', 'UPC': '' }];
}