diff --git a/src/js/core/factories/Grid.js b/src/js/core/factories/Grid.js index 9a9547a61c..d176826f96 100644 --- a/src/js/core/factories/Grid.js +++ b/src/js/core/factories/Grid.js @@ -917,7 +917,7 @@ angular.module('ui.grid') var self = this; self.rowBuilders.forEach(function (builder) { - builder.call(self, gridRow, self.gridOptions); + builder.call(self, gridRow, self.options); }); return gridRow; diff --git a/test/unit/core/factories/Grid.spec.js b/test/unit/core/factories/Grid.spec.js index 6e36cd8536..5879599e9d 100644 --- a/test/unit/core/factories/Grid.spec.js +++ b/test/unit/core/factories/Grid.spec.js @@ -174,6 +174,21 @@ describe('Grid factory', function () { }).toThrow(); }); }); + + describe('row builder', function () { + function testObj () { } + + it('should return a defined gridOptions', function () { + var testRowBuilder = function (row, gridOptions) { + expect(gridOptions).toBeDefined(); + }; + var row = new GridRow({str:'abc'}, 0, grid); + testObj.testRowBuilder = jasmine.createSpy('testRowBuilder').andCallFake(testRowBuilder); + grid.registerRowBuilder(testObj.testRowBuilder); + grid.processRowBuilders(row); + expect(testObj.testRowBuilder).toHaveBeenCalled(); + }); + }); describe('renderContainers', function () { it('should have a body render container', function () {