Skip to content

v0.4.3

Compare
Choose a tag to compare
@l-lin l-lin released this 10 May 14:39
· 497 commits to master since this release

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);
    }
}