Skip to content

Fix #1792(options): use gridOptions rather than copy them #1869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2014
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions misc/tutorial/105_footer.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ show the aggregation but without a label. Refer the third column in the example
</file>
<file name="index.html">
<div ng-controller="MainCtrl">
<button id="footerButton" class="btn btn-success" ng-click="gridOptions.showFooter = !gridOptions.showFooter">Toggle Footer</button>
<div id="grid1" ui-grid="gridOptions" class="grid"></div>
</div>
</file>
Expand Down
9 changes: 3 additions & 6 deletions src/js/core/factories/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ angular.module('ui.grid')
delete options.id;

// Get default options
self.options = new GridOptions();

// Extend the default options with what we were passed in
angular.extend(self.options, options);
self.options = GridOptions.initialize( options );

self.headerHeight = self.options.headerRowHeight;
self.footerHeight = self.options.showFooter === true ? self.options.footerRowHeight : 0;
Expand Down Expand Up @@ -322,7 +319,7 @@ angular.module('ui.grid')
* @name deregisterDataChangeCallback
* @methodOf ui.grid.class:Grid
* @description Delete the callback identified by the id.
* @param {string} uid uid of the callback to be deregistered
* @param {string} uid the uid of the function that is to be deregistered
*/
Grid.prototype.deregisterDataChangeCallback = function deregisterDataChangeCallback(uid) {
delete this.dataChangeCallbacks[uid];
Expand All @@ -333,7 +330,7 @@ angular.module('ui.grid')
* @name callDataChangeCallbacks
* @methodOf ui.grid.class:Grid
* @description Calls the callbacks based on the type of data change that
* has occurred. Always calls the ALL callbacks, calls the ROW, EDIT and COLUMN callbacks if the
* has occurred. Always calls the ALL callbacks, calls the ROW, EDIT, and COLUMN callbacks if the
* event type is matching, or if the type is ALL.
* @param {number} type the type of event that occurred - one of the
* uiGridConstants.dataChange values (ALL, ROW, EDIT, COLUMN)
Expand Down
Loading