|
225 | 225 | $elem.dataTable(options);
|
226 | 226 | }, 0, false);
|
227 | 227 | };
|
228 |
| - var _renderDataTableIfNoNgRows = function ($elem, options, isNgDisplay) { |
| 228 | + var _renderDataTableIfNoNgRows = function ($elem, isNgDisplay, options) { |
229 | 229 | if (!isNgDisplay) {
|
230 | 230 | _doRenderDataTable($elem, options);
|
231 | 231 | }
|
|
252 | 252 | if (angular.isObject(options.dataPromise)) {
|
253 | 253 | options.dataPromise.then(function (data) {
|
254 | 254 | options.aaData = data;
|
255 |
| - _renderDataTableIfNoNgRows($elem, options, isNgDisplay); |
| 255 | + _renderDataTableIfNoNgRows($elem, isNgDisplay, options); |
256 | 256 | });
|
257 |
| - } else if (angular.isDefined(options.sAjaxSource)) { |
258 |
| - // Define default values in case it is an ajax datatables |
259 |
| - if (angular.isUndefined(options.sAjaxDataProp)) { |
260 |
| - options.sAjaxDataProp = DT_DEFAULT_OPTIONS.sAjaxDataProp; |
261 |
| - } |
262 |
| - if (angular.isUndefined(options.aoColumns)) { |
263 |
| - options.aoColumns = DT_DEFAULT_OPTIONS.aoColumns; |
| 257 | + } else { |
| 258 | + if (angular.isDefined(options.sAjaxSource)) { |
| 259 | + // Define default values in case it is an ajax datatables |
| 260 | + if (angular.isUndefined(options.sAjaxDataProp)) { |
| 261 | + options.sAjaxDataProp = DT_DEFAULT_OPTIONS.sAjaxDataProp; |
| 262 | + } |
| 263 | + if (angular.isUndefined(options.aoColumns)) { |
| 264 | + options.aoColumns = DT_DEFAULT_OPTIONS.aoColumns; |
| 265 | + } |
264 | 266 | }
|
265 |
| - _renderDataTableIfNoNgRows($elem, options, isNgDisplay); |
| 267 | + _renderDataTableIfNoNgRows($elem, isNgDisplay); |
266 | 268 | }
|
267 | 269 | } else {
|
268 |
| - _renderDataTableIfNoNgRows($elem, options, isNgDisplay); |
| 270 | + _renderDataTableIfNoNgRows($elem, isNgDisplay); |
269 | 271 | }
|
270 | 272 | $scope.$on(DT_LAST_ROW_KEY, function () {
|
271 | 273 | _doRenderDataTable($elem, options);
|
|
0 commit comments