Skip to content

Commit 2da7142

Browse files
authored
Fixed erroneous commit
1 parent bcc70db commit 2da7142

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

partial/examples/examples.js

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ angular.module('generic.table').controller('DocumentationController',function($s
5757
}
5858
],
5959
data:[{
60+
"name":"gt-id (optional)",
61+
"type":"number",
62+
"default":"id of table scope",
63+
"description":"unique id for table, if none is passed, the scope id will be returned. Use id together with events"
64+
},{
65+
"name":"gt-classes (optional)",
66+
"type":"string",
67+
"default":"",
68+
"description":"add classes to table element e.g. table-bordered, table-condensed etc. for bootstrap styles"
69+
},{
6070
"name":"gt-data (optional)",
6171
"type":"array",
6272
"default":"",
@@ -193,21 +203,21 @@ angular.module('generic.table').controller('DocumentationController',function($s
193203
}
194204
],
195205
data:[{
196-
"name":"gt-update-table",
206+
"name":"gt-update-table:gtId",
197207
"description":"update table data",
198-
"options":"data array, ie. $scope.$broadcast('gt-update-table', data);"
208+
"options":"data array, ie. $scope.$broadcast('gt-update-table:tableId', data);"
199209
},{
200-
"name":"gt-update-structure",
210+
"name":"gt-update-structure:gtId",
201211
"description":"update structure of table (settings and field definitions)",
202-
"options":"object, ie. $scope.$broadcast('gt-update-structure', {fields:[],settings:[]});"
212+
"options":"object, ie. $scope.$broadcast('gt-update-structure:tableId', {fields:[],settings:[]});"
203213
},{
204-
"name":"gt-paginate-table",
214+
"name":"gt-paginate-table:gtId",
205215
"description":"change how many rows are visible",
206-
"options":"number, ie. $scope.$broadcast('gt-paginate-table', 10);"
216+
"options":"number, ie. $scope.$broadcast('gt-paginate-table:tableId', 10);"
207217
},{
208-
"name":"gt-export-csv",
218+
"name":"gt-export-csv:gtId",
209219
"description":"export table data to csv, <a href='/#examples#exportOptions'>see all export options</a>.",
210-
"options":"export settings object, ie. $scope.$broadcast('gt-export-csv', {fileName:'my-custom-export'});"
220+
"options":"export settings object, ie. $scope.$broadcast('gt-export-csv:tableId', {fileName:'my-custom-export'});"
211221
}]
212222
};
213223

@@ -349,7 +359,8 @@ angular.module('generic.table').controller('DocumentationController',function($s
349359
}).controller('CustomRenderExampleController',function($scope, mockService,$filter,$sce){
350360

351361
$scope.exportCsv = function() {
352-
$scope.$broadcast('gt-export-csv');
362+
console.log($scope.tableCustomRender.id);
363+
$scope.$broadcast('gt-export-csv:'+$scope.tableCustomRender.id);
353364
};
354365

355366

@@ -418,20 +429,19 @@ angular.module('generic.table').controller('DocumentationController',function($s
418429
};
419430

420431
mockService.getJsonData().then(function(res){
421-
$scope.$broadcast("gt-update-table", res);
432+
$scope.$broadcast("gt-update-table:"+$scope.tableCustomRender.id, res);
422433
});
423434

424435

425436
}).factory('mockService',function($resource, $http) {
426437

427438
/* remote service example
428-
function getData () {
429-
var url = 'http://example.com/json.json';
430-
return $http.jsonp(url).then(function (response) {
431-
return response.data;
432-
});
433-
434-
}*/
439+
function getData () {
440+
var url = 'http://example.com/json.json';
441+
return $http.jsonp(url).then(function (response) {
442+
return response.data;
443+
});
444+
}*/
435445

436446
function getJsonData(){
437447
var url = './partial/examples/mock-data.json';
@@ -444,4 +454,4 @@ angular.module('generic.table').controller('DocumentationController',function($s
444454
return {
445455
"getJsonData":getJsonData
446456
};
447-
});
457+
});

0 commit comments

Comments
 (0)