@@ -48,7 +48,7 @@ <h3><code>DTOptionsBuilder</code></h3>
48
48
</ tr >
49
49
< tr >
50
50
< td > < code > DTOptionsBuilder</ code > </ td >
51
- < td > < code > fromSource(sAjaxSource )</ code > </ td >
51
+ < td > < code > fromSource(ajax )</ code > </ td >
52
52
< td >
53
53
< p > Create a wrapped datatables options with initialized ajax source.</ p >
54
54
< div hljs language ="js ">
@@ -118,7 +118,7 @@ <h3><code>DTOptionsBuilder</code></h3>
118
118
</ tr >
119
119
< tr >
120
120
< td > < code > DTOptions</ code > </ td >
121
- < td > < code > withSource(sAjaxSource )</ code > </ td >
121
+ < td > < code > withSource(ajax )</ code > </ td >
122
122
< td >
123
123
< p > Set the ajax source.</ p >
124
124
< div hljs language ="js ">
@@ -313,7 +313,8 @@ <h3><code>DTOptionsBuilder</code></h3>
313
313
< td >
314
314
< p > Add < a href ="http://getbootstrap.com "> bootstrap</ a > compatibility.</ p >
315
315
< div hljs language ="js ">
316
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
316
+ angular.module('myModule', ['datatables', 'datatables.bootstrap'])
317
+ .controller('MyCtrl', MyCtrl);
317
318
function MyCtrl(DTOptionsBuilder) {
318
319
var vm = this;
319
320
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -331,7 +332,12 @@ <h3><code>DTOptionsBuilder</code></h3>
331
332
Angular datatables provides default options. You can check them out on < a href ="https://github.com/l-lin/angular-datatables/blob/dev/src/angular-datatables.bootstrap.options.js "> Github</ a > .
332
333
</ p >
333
334
< div hljs language ="js ">
334
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
335
+ angular.module('myModule', [
336
+ 'datatables',
337
+ 'datatables.bootstrap',
338
+ 'datatables.tabletools',
339
+ 'datatables.colvis'
340
+ ]).controller('MyCtrl', MyCtrl);
335
341
function MyCtrl(DTOptionsBuilder) {
336
342
var vm = this;
337
343
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -374,7 +380,8 @@ <h3><code>DTOptionsBuilder</code></h3>
374
380
< td >
375
381
< p > Add < a href ="https://datatables.net/extras/colreorder/ "> ColReorder compatibility.</ a > </ p >
376
382
< div hljs language ="js ">
377
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
383
+ angular.module('myModule', ['datatables', 'datatables.colreorder'])
384
+ .controller('MyCtrl', MyCtrl);
378
385
function MyCtrl(DTOptionsBuilder) {
379
386
var vm = this;
380
387
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -386,8 +393,8 @@ <h3><code>DTOptionsBuilder</code></h3>
386
393
</ p >
387
394
< div hljs language ="json ">
388
395
{
389
- "sAjaxSource ": "data.json",
390
- "sDom ": "Rlfrtip"
396
+ "ajax ": "data.json",
397
+ "dom ": "Rlfrtip"
391
398
}
392
399
</ div >
393
400
< p class ="text-info ">
@@ -401,7 +408,8 @@ <h3><code>DTOptionsBuilder</code></h3>
401
408
< td >
402
409
< p > Add option to the attribute < code > oColReorder</ code > .</ p >
403
410
< div hljs language ="js ">
404
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
411
+ angular.module('myModule', ['datatables', 'datatables.colreorder'])
412
+ .controller('MyCtrl', MyCtrl);
405
413
function MyCtrl(DTOptionsBuilder) {
406
414
var vm = this;
407
415
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -415,8 +423,8 @@ <h3><code>DTOptionsBuilder</code></h3>
415
423
</ p >
416
424
< div hljs language ="json ">
417
425
{
418
- "sAjaxSource ": "data.json",
419
- "sDom ": "Rlfrtip",
426
+ "ajax ": "data.json",
427
+ "dom ": "Rlfrtip",
420
428
"oColReorder": {
421
429
"iFixedColumnsRight": 1
422
430
}
@@ -430,7 +438,8 @@ <h3><code>DTOptionsBuilder</code></h3>
430
438
< td >
431
439
< p > Set the default column order.</ p >
432
440
< div hljs language ="js ">
433
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
441
+ angular.module('myModule', ['datatables', 'datatables.colreorder'])
442
+ .controller('MyCtrl', MyCtrl);
434
443
function MyCtrl(DTOptionsBuilder) {
435
444
var vm = this;
436
445
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -444,8 +453,8 @@ <h3><code>DTOptionsBuilder</code></h3>
444
453
</ p >
445
454
< div hljs language ="json ">
446
455
{
447
- "sAjaxSource ": "data.json",
448
- "sDom ": "Rlfrtip",
456
+ "ajax ": "data.json",
457
+ "dom ": "Rlfrtip",
449
458
"oColReorder": {
450
459
"aiOrder": [1, 0, 2]
451
460
}
@@ -459,7 +468,8 @@ <h3><code>DTOptionsBuilder</code></h3>
459
468
< td >
460
469
< p > Set the reorder callback function.</ p >
461
470
< div hljs language ="js ">
462
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
471
+ angular.module('myModule', ['datatables', 'datatables.colreorder']])
472
+ .controller('MyCtrl', MyCtrl);
463
473
function MyCtrl(DTOptionsBuilder) {
464
474
var vm = this;
465
475
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -474,8 +484,8 @@ <h3><code>DTOptionsBuilder</code></h3>
474
484
</ p >
475
485
< div hljs language ="json ">
476
486
{
477
- "sAjaxSource ": "data.json",
478
- "sDom ": "Rlfrtip",
487
+ "ajax ": "data.json",
488
+ "dom ": "Rlfrtip",
479
489
"oColReorder": {
480
490
"fnReorderCallback": function () {
481
491
console.log('Columns order has been changed with: ' + this.fnOrder());
@@ -491,7 +501,8 @@ <h3><code>DTOptionsBuilder</code></h3>
491
501
< td >
492
502
< p > Add < a href ="https://datatables.net/extras/colvis/ "> ColVis</ a > compatibility.</ p >
493
503
< div hljs language ="js ">
494
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
504
+ angular.module('myModule', ['datatables', 'datatables.colvis']])
505
+ .controller('MyCtrl', MyCtrl);
495
506
function MyCtrl(DTOptionsBuilder) {
496
507
var vm = this;
497
508
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -503,8 +514,8 @@ <h3><code>DTOptionsBuilder</code></h3>
503
514
</ p >
504
515
< div hljs language ="json ">
505
516
{
506
- "sAjaxSource ": "data.json",
507
- "sDom ": "Clfrtip"
517
+ "ajax ": "data.json",
518
+ "dom ": "Clfrtip"
508
519
}
509
520
</ div >
510
521
< p class ="text-info ">
@@ -518,7 +529,8 @@ <h3><code>DTOptionsBuilder</code></h3>
518
529
< td >
519
530
< p > Add option to the attribute < code > oColVis</ code > .</ p >
520
531
< div hljs language ="js ">
521
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
532
+ angular.module('myModule', ['datatables', 'datatables.colvis']])
533
+ .controller('MyCtrl', MyCtrl);
522
534
function MyCtrl(DTOptionsBuilder) {
523
535
var vm = this;
524
536
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -532,8 +544,8 @@ <h3><code>DTOptionsBuilder</code></h3>
532
544
</ p >
533
545
< div hljs language ="json ">
534
546
{
535
- "sAjaxSource ": "data.json",
536
- "sDom ": "Clfrtip",
547
+ "ajax ": "data.json",
548
+ "dom ": "Clfrtip",
537
549
"oColVis": {
538
550
"aiExclude": [2]
539
551
}
@@ -547,7 +559,8 @@ <h3><code>DTOptionsBuilder</code></h3>
547
559
< td >
548
560
< p > Set the state change function.</ p >
549
561
< div hljs language ="js ">
550
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
562
+ angular.module('myModule', ['datatables', 'datatables.colvis'])
563
+ .controller('MyCtrl', MyCtrl);
551
564
function MyCtrl(DTOptionsBuilder) {
552
565
var vm = this;
553
566
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -564,8 +577,8 @@ <h3><code>DTOptionsBuilder</code></h3>
564
577
</ p >
565
578
< div hljs language ="json ">
566
579
{
567
- "sAjaxSource ": "data.json",
568
- "sDom ": "Clfrtip",
580
+ "ajax ": "data.json",
581
+ "dom ": "Clfrtip",
569
582
"oColVis": {
570
583
"fnStateChange": function (iColumn, bVisible) {
571
584
console.log('The column', iColumn, 'has changed its status to', bVisible);
@@ -581,7 +594,8 @@ <h3><code>DTOptionsBuilder</code></h3>
581
594
< td >
582
595
< p > Add < a href ="https://datatables.net/extras/tabletools/ "> TableTools</ a > compatibility.</ p >
583
596
< div hljs language ="js ">
584
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
597
+ angular.module('myModule', ['datatables', 'datatables.tabletools'])
598
+ .controller('MyCtrl', MyCtrl);
585
599
function MyCtrl(DTOptionsBuilder) {
586
600
var vm = this;
587
601
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -596,8 +610,8 @@ <h3><code>DTOptionsBuilder</code></h3>
596
610
</ p >
597
611
< div hljs language ="json ">
598
612
{
599
- "sAjaxSource ": "data.json",
600
- "sDom ": "Tlfrtip",
613
+ "ajax ": "data.json",
614
+ "dom ": "Tlfrtip",
601
615
"oTableTools": {
602
616
"sSwfPath": "vendor/datatables-tabletools/swf/copy_csv_xls_pdf.swf"
603
617
}
@@ -614,7 +628,8 @@ <h3><code>DTOptionsBuilder</code></h3>
614
628
< td >
615
629
< p > Add option to the attribute < code > oTableTools</ code > .</ p >
616
630
< div hljs language ="js ">
617
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
631
+ angular.module('myModule', ['datatables', 'datatables.tabletools'])
632
+ .controller('MyCtrl', MyCtrl);
618
633
function MyCtrl(DTOptionsBuilder) {
619
634
var vm = this;
620
635
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -628,8 +643,8 @@ <h3><code>DTOptionsBuilder</code></h3>
628
643
</ p >
629
644
< div hljs language ="json ">
630
645
{
631
- "sAjaxSource ": "data.json",
632
- "sDom ": "Tlfrtip",
646
+ "ajax ": "data.json",
647
+ "dom ": "Tlfrtip",
633
648
"oTableTools": {
634
649
"sSwfPath": "vendor/datatables-tabletools/swf/copy_csv_xls_pdf.swf",
635
650
"sRowSelect": "single"
@@ -644,7 +659,8 @@ <h3><code>DTOptionsBuilder</code></h3>
644
659
< td >
645
660
< p > Set the table tools buttons to display.</ p >
646
661
< div hljs language ="js ">
647
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
662
+ angular.module('myModule', ['datatables', 'datatables.tabletools'])
663
+ .controller('MyCtrl', MyCtrl);
648
664
function MyCtrl(DTOptionsBuilder) {
649
665
var vm = this;
650
666
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -665,8 +681,8 @@ <h3><code>DTOptionsBuilder</code></h3>
665
681
</ p >
666
682
< div hljs language ="json ">
667
683
{
668
- "sAjaxSource ": "data.json",
669
- "sDom ": "Tlfrtip",
684
+ "ajax ": "data.json",
685
+ "dom ": "Tlfrtip",
670
686
"oTableTools": {
671
687
"sSwfPath": "vendor/datatables-tabletools/swf/copy_csv_xls_pdf.swf",
672
688
"aButtons": [
@@ -684,7 +700,7 @@ <h3><code>DTOptionsBuilder</code></h3>
684
700
</ tr >
685
701
< tr >
686
702
< td > < code > DTOptions</ code > </ td >
687
- < td > < code > withDOM(sDom )</ code > </ td >
703
+ < td > < code > withDOM(dom )</ code > </ td >
688
704
< td >
689
705
< p > Override the < a href ="http://datatables.net/examples/basic_init/dom.html "> DOM positioning</ a > of the DataTable.</ p >
690
706
< div hljs language ="js ">
@@ -706,7 +722,8 @@ <h3><code>DTOptionsBuilder</code></h3>
706
722
< td >
707
723
< p > Add < a href ="http://datatables.net/extensions/scroller/ "> Scroller</ a > compatibility.</ p >
708
724
< div hljs language ="js ">
709
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
725
+ angular.module('myModule', ['datatables', 'datatables.scroller'])
726
+ .controller('MyCtrl', MyCtrl);
710
727
function MyCtrl(DTOptionsBuilder) {
711
728
var vm = this;
712
729
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -718,8 +735,8 @@ <h3><code>DTOptionsBuilder</code></h3>
718
735
</ p >
719
736
< div hljs language ="json ">
720
737
{
721
- "sAjaxSource ": "data.json",
722
- "sDom ": "lfrtipS"
738
+ "ajax ": "data.json",
739
+ "dom ": "lfrtipS"
723
740
}
724
741
</ div >
725
742
< p class ="text-info ">
@@ -729,13 +746,14 @@ <h3><code>DTOptionsBuilder</code></h3>
729
746
</ tr >
730
747
< tr >
731
748
< td > < code > DTOptions</ code > </ td >
732
- < td > < code > withColumnFilter()</ code > </ td >
749
+ < td > < code > withColumnFilter(columnFilterOptions )</ code > </ td >
733
750
< td >
734
751
< p >
735
752
Add < a href ="http://jquery-datatables-column-filter.googlecode.com/svn/trunk/index.html "> Columnfilter</ a > compatibility.
736
753
</ p >
737
754
< div hljs language ="js ">
738
- angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
755
+ angular.module('myModule', ['datatables', 'datatables.columnfilter'])
756
+ .controller('MyCtrl', MyCtrl);
739
757
function MyCtrl(DTOptionsBuilder) {
740
758
var vm = this;
741
759
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
@@ -745,5 +763,31 @@ <h3><code>DTOptionsBuilder</code></h3>
745
763
}
746
764
</ div >
747
765
</ td >
766
+ </ tr >
767
+ < tr >
768
+ < td > < code > DTOptions</ code > </ td >
769
+ < td > < code > withFixedColumns(fixedColumnsOptions)</ code > </ td >
770
+ < td >
771
+ < p >
772
+ Add < a href ="https://datatables.net/extensions/fixedcolumns/ "> FixedColumns</ a > compatibility.
773
+ </ p >
774
+ < div hljs language ="js ">
775
+ angular.module('myModule', ['datatables', 'datatables.fixedcolumns'])
776
+ .controller('MyCtrl', MyCtrl);
777
+ function MyCtrl(DTOptionsBuilder) {
778
+ var vm = this;
779
+ vm.dtOptions = DTOptionsBuilder.newOptions()
780
+ .withOption('scrollY', '300px')
781
+ .withOption('scrollX', '100%')
782
+ .withOption('scrollCollapse', true)
783
+ .withOption('paging', false)
784
+ .withFixedColumns({
785
+ leftColumns: 1,
786
+ rightColumns: 1
787
+ });
788
+ }
789
+ </ div >
790
+ </ td >
791
+ </ tr >
748
792
</ tbody >
749
793
</ table >
0 commit comments