Skip to content

Releases: l-lin/angular-datatables

v0.5.0

07 Sep 09:49
Compare
Choose a tag to compare

This release contains the following:

  • Removing the DTInstances.getLast() and DTInstances.getList() as they are deprecated #315
  • Add MIT licence in bower.json #317
  • Update examples:
    • how to pass an object in the ng-click in the renderWith function #145
    • how to switch language when using angular-translate #351
    • how to add a custom button in the DT DOM #402
    • Fix fixedHeader example #372
    • Fix the row select example
  • add the $elem in the parameter of _redrawRows #321
  • Destroy the child scope when data is refreshed in the "Angular way" #326
  • Add support for commonjs #332
  • Correct the usage of DTDefaultOptions.setLanguageSource with the Angular renderer #356
  • Add support for Light column filter #431
  • Throw an error if the option serverSide is set to true and the table is not renderer by the Ajax renderer
  • Avoid exception when using multiple datatables with the Angular renderer #310

v0.4.3

10 May 14:39
Compare
Choose a tag to compare

This release contains the following:

  • Correct docs #264 #274
  • Enable regexp to find ngRepeat comment in multiple lines #252
  • Add plugins files to bower.json #260
  • Correct reloadData() #266
  • Add parameter [callback, resetPaging] when reloading data from Ajax source #273
  • Correctly display the "processing" div with Bootstrap #281
  • Correctly display the sort icons when combining Bootstrap and Scroller plugins #280
  • Some attempts to improve the DTInstances service #282 #284
  • Add an option to reset or note the paging when reloading or changing the data with the Promise renderer #306
vm.dtOptions = DTOptionsBuilder.newOptions().withOption('redraw', false);
  • Add the possibility to provide an object or a callback function to fetch the DT instance #307
    • The DTInstances service will be removed in the v0.5.0+. Use this approach instead:
<div ng-controller="ShowCaseCtrl as showCase">
    <table datatable
           dt-options="showCase.dtOptions"
           dt-instance="showCase.dtInstance">
    </table>
</div>
angular.controller('ShowCaseCtrl ', ShowCaseCtrl );
function ShowCaseCtrl(DTOptionsBuilder) {
    var vm = this;
    vm.dtInstance = {}; // This will be set automatically with the two-way data binding
    vm.dtOptions = DTOptionsBuilder.fromSource('data.json');
}

The user also have the possibility to set a callback function instead of a variable:

<div ng-controller="ShowCaseCtrl as showCase">
    <table datatable
           dt-options="showCase.dtOptions" 
           dt-instance="showCase.dtInstanceCallback">
    </table>
</div>
angular.controller('ShowCaseCtrl ', ShowCaseCtrl );
function ShowCaseCtrl(DTOptionsBuilder) {
    var vm = this;
    vm.dtInstances = [];
    vm.dtOptions = DTOptionsBuilder.fromSource('data.json');
    vm.dtInstanceCallback = dtInstanceCallback;

    function dtInstanceCallback(dtInstance) {
        vm.dtInstances.push(dtInstance);
    }
}

v0.4.2

15 Mar 09:55
Compare
Choose a tag to compare

This release contains the following:

  • Correction bug "'destroy' of undefined" #235
  • Add the possibility to call DTInstances.getList() and DTInstances.getLast() wherever you are #234

v0.4.1

02 Mar 12:14
Compare
Choose a tag to compare

This release the following:

  • Bug fix on DTInstances.getList() #198
  • Fix for nested data objects when loading table with a promise #214
  • Fixes for IE8. Replace missing IE8 Array methods forEach and indexOf with Angular and JQuery equivalents #216
  • Some updates on documentation

v0.4.0

23 Jan 22:34
Compare
Choose a tag to compare

Lots of changes in this release! :shipit:

  • The message event:loadedDT is no longer emitted. Instead, there is a new service DTInstances that provides the list of the DataTables that are instanciated #174.

You can fetch the instances like this:

DTInstances.getLast().then(function(lastDTInstance) {
    // lastDTInstance === {"id": "foobar2", "DataTable": oTable, "dataTable": $oTable, "reloadData": fnReloadData, "changeData": fnChangeData}

    // loadedDT.DataTable is the DataTable API instance
    // loadedDT.dataTable is the jQuery Object
    // See http://datatables.net/manual/api#Accessing-the-API
});
DTInstances.getList().then(function(dtInstances) {
    /*
     * dtInstances === {
     *      "foobar": {"id": "foobar2", "DataTable": oTable, "dataTable": $oTable, "reloadData": fnReloadData, "changeData": fnChangeData},
     *      "foobar2": {"id": "foobar2", "DataTable": oTable, "dataTable": $oTable, "reloadData": fnReloadData, "changeData": fnChangeData}
     * }
     */
});

The clumsy API dtOptions.reload() has been moved to the directive instance. Indeed, reloading data should not be on the options of the DT. It should rather be within the method of the instance of the directive.
Now, to reload the data, you will have to do it like this:

DTInstances.getLast().then(function(dtInstance) {
    dtInstance.reloadData();
});
  • Expose method to change the data:
angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
function MyCtrl($resource, DTInstances) {
    DTInstances.getLast().then(function(dtInstance) {
        // For Ajax renderers
        dtInstance.changeData('data.json');
        // For Promise renderers
        dtInstance.changeData(function() {
            return $resource('data.json').query().$promise;
        });
    });
}

⚠️ This API is only available for the Ajax Renderer and Promise Renderer!

  • Expose method to rerender the entire directive #157
DTInstances.getLast().then(function (dtInstance) {
    dtInstance.rerender();
});

⚠️ This is not the same as DataTable's draw(); API. It will completely remove the table, then it will re-render the table, resending the request to the server if necessarily. ⚠️

  • Separate the plugins in different dist files #160

For example, if you need to add DataTables ColVis plugin support, then you will need to add the file angular-datatables/dist/plugins/colvis/angular-datatables.colvis.min.js and your Angular needs to add a dependency to datatables.colvis along with datatables.

  • FixedColumns integration enhancement #142
  • FixedHeader support #196
  • Bug fixes:
    • Correction when rendering with the Angular way and when using a language url #181 #150
    • Issue about using Bootstrap with Scroller #189
    • Cannot change the options when using the Promise renderer #139 #172
    • Header can not be modified when datatable is filled from promise or ajax #149

v0.3.1

10 Jan 12:13
Compare
Choose a tag to compare

This release contains the following:

  • Add the possibility to override the Bootstrap pagination container CSS classes #135
vm.dtOptions = DTOptionsBuilder
    .fromSource('data.json')
    // Add Bootstrap compatibility
    .withBootstrap()
    .withBootstrapOptions({
        pagination: {
            classes: {
                ul: 'pagination pagination-sm'
            }
        }
    });
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
    .withPaginationType('full_numbers')
    .withColumnFilter({
        aoColumns: [{
            type: 'number'
        }, {
            type: 'text',
            bRegex: true,
            bSmart: true
        }, {
            type: 'select',
            values: ['Yoda', 'Titi', 'Kyle', 'Bar', 'Whateveryournameis']
        }]
    });
  • Remove unecessary $timeout #146
  • Improve Angular digest performance by allowing watching table definitions shallowly #144
    • The angular-datatables uses deep search for changes on every $digest cycle. Meaning every time any Angular event happens (ng-clicks, etc.), the entire array, each of it's children, it's children's children, and so forth gets compared to a cached copy.
    • There is an attribute to add so that if the directive has a truthy value for dt-disable-deep-watchers at compile time then it will use $watchCollection(...) instead. This would allow users to prevent big datasets from thrashing Angular's $digest cycle at their own discretion.
<table datatable dt-options="showCase.dtOptions" 
    dt-columns="showCase.dtColumns" 
    dt-disable-deep-watchers="true" 
    class="row-border hover">
</table>
vm.dtColumns = [
        DTColumnBuilder.newColumn('id', $translate('id')),
        DTColumnBuilder.newColumn('firstName').withTitle($translate('firstName')),
        DTColumnBuilder.newColumn('lastName').withTitle($translate('lastName'))
    ];
  • Correction on Scroller plugin that no longer worked #147

v0.3.0

22 Nov 14:57
Compare
Choose a tag to compare

This release contains the following:

  • Add the possibility to use AjaxDataProp for promises #111
$scope.dtOptions = DTOptions.fromFnPromise(function() {
        return $resource('data.json').query().$promise;
    })
    .withDataProp('data');
  • Loading DT options with a promise #113
$scope.dtOptions = $resource('/angular-datatables/dtOptions.json').get().$promise;
$scope.dtColumns = $resource('/angular-datatables/dtColumns.json').query().$promise;
  • Correct documentation
  • Support Angular 1.3 #97 #110

v0.2.1

18 Oct 12:50
Compare
Choose a tag to compare

This release contains the following:

  • Various updates in the documentation
  • Correction on ID on the emitting message
  • Expose the dataTable and DataTable instances #86:
$scope.$on('event:dataTableLoaded', function(event, loadedDT) {
    // loadedDT === {"id": "foobar", "DataTable": oTable, "dataTable": $oTable}

    // loadedDT.DataTable is the DataTable API instance
    // loadedDT.dataTable is the jQuery Object
    // See http://datatables.net/manual/api#Accessing-the-API
});
  • Add additional jasmine specs
  • Correct data reload issues multiple requests #85
  • Correct insertBefore may fail using the AngularWay #91
  • Fix regex for the Angular way #100
  • Integration with scroller plugin #67

v0.2.0

20 Sep 14:37
Compare
Choose a tag to compare

This release contains the following:

  • Correction on service names (no more $ prefixes). So you must now call DTDefaultOptions instead of $DTDefaultOptions
  • DataTables v.1.9.7 is no longer supported
  • The directive ngRows is removed.
  • Various updates on documentation

v0.1.1

06 Sep 12:26
Compare
Choose a tag to compare

This release contains the following:

  • Expose the DataTable object in the event #64:
$scope.$on('event:dataTableLoaded', function(event, loadedDT) {
    // loadedDT === {"id": "foobar", dt: oTable}
});
  • Several corrections on bower.json #65
  • Correct issue when changing data with the "Angular way" #63
  • Update documentations (no RequireJS support)