Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit ecba70d

Browse files
committed
Fix reload data with ng renderer and fixedColumns #254
1 parent f0c7554 commit ecba70d

35 files changed

+920
-552
lines changed

dist/plugins/fixedcolumns/angular-datatables.fixedcolumns.js

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ if (typeof module !== "undefined" && typeof exports !== "undefined" && module.ex
1212

1313
// See https://datatables.net/extensions/fixedcolumns/
1414
angular.module('datatables.fixedcolumns', ['datatables'])
15-
.config(dtFixedColumnsConfig)
16-
.run(initFixedColumnsPlugin);
15+
.config(dtFixedColumnsConfig);
1716

1817
/* @ngInject */
1918
function dtFixedColumnsConfig($provide) {
@@ -47,9 +46,9 @@ function dtFixedColumnsConfig($provide) {
4746
* @returns {DTOptions} the options
4847
*/
4948
function withFixedColumns(fixedColumnsOptions) {
50-
options.hasFixedColumns = true;
49+
options.fixedColumns = true;
5150
if (fixedColumnsOptions) {
52-
options.fixedColumnsOptions = fixedColumnsOptions;
51+
options.fixedColumns = fixedColumnsOptions;
5352
}
5453
return options;
5554
}
@@ -59,20 +58,5 @@ function dtFixedColumnsConfig($provide) {
5958
}
6059
dtFixedColumnsConfig.$inject = ['$provide'];
6160

62-
/* @ngInject */
63-
function initFixedColumnsPlugin(DTRendererService) {
64-
var fixedColumnsPlugin = {
65-
postRender: postRender
66-
};
67-
DTRendererService.registerPlugin(fixedColumnsPlugin);
68-
69-
function postRender(options, result) {
70-
if (options && options.hasFixedColumns) {
71-
new $.fn.dataTable.FixedColumns(result.DataTable, options.fixedColumnsOptions);
72-
}
73-
}
74-
}
75-
initFixedColumnsPlugin.$inject = ['DTRendererService'];
76-
7761

7862
})(window, document, jQuery, angular);

dist/plugins/fixedcolumns/angular-datatables.fixedcolumns.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/fixedcolumns/angular-datatables.fixedcolumns.js

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
// See https://datatables.net/extensions/fixedcolumns/
44
angular.module('datatables.fixedcolumns', ['datatables'])
5-
.config(dtFixedColumnsConfig)
6-
.run(initFixedColumnsPlugin);
5+
.config(dtFixedColumnsConfig);
76

87
/* @ngInject */
98
function dtFixedColumnsConfig($provide) {
@@ -37,26 +36,12 @@ function dtFixedColumnsConfig($provide) {
3736
* @returns {DTOptions} the options
3837
*/
3938
function withFixedColumns(fixedColumnsOptions) {
40-
options.hasFixedColumns = true;
39+
options.fixedColumns = true;
4140
if (fixedColumnsOptions) {
42-
options.fixedColumnsOptions = fixedColumnsOptions;
41+
options.fixedColumns = fixedColumnsOptions;
4342
}
4443
return options;
4544
}
4645
}
4746
}
4847
}
49-
50-
/* @ngInject */
51-
function initFixedColumnsPlugin(DTRendererService) {
52-
var fixedColumnsPlugin = {
53-
postRender: postRender
54-
};
55-
DTRendererService.registerPlugin(fixedColumnsPlugin);
56-
57-
function postRender(options, result) {
58-
if (options && options.hasFixedColumns) {
59-
new $.fn.dataTable.FixedColumns(result.DataTable, options.fixedColumnsOptions);
60-
}
61-
}
62-
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
22
"name": "datatables-fixedcolumns",
3-
"version": "3.0.2",
3+
"version": "3.2.0",
44
"main": [
55
"js/dataTables.fixedColumns.js",
6-
"css/dataTables.fixedColumns.css"
6+
"css/fixedColumns.dataTables.scss"
77
],
88
"dependencies": {
99
"jquery": ">=1.7.0",
1010
"datatables": ">=1.8.0"
1111
},
1212
"homepage": "https://github.com/DataTables/FixedColumns",
13-
"_release": "3.0.2",
13+
"_release": "3.2.0",
1414
"_resolution": {
1515
"type": "version",
16-
"tag": "3.0.2",
17-
"commit": "f06274d261d9c62de659add7e7062c1dfee29ec8"
16+
"tag": "3.2.0",
17+
"commit": "73d8b8c6c8b072c2ff71db3987162692425e084a"
1818
},
1919
"_source": "git://github.com/DataTables/FixedColumns.git",
20-
"_target": "3.0.2",
20+
"_target": "3.2.0",
2121
"_originalSource": "datatables-fixedcolumns",
2222
"_direct": true
2323
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT license
2+
3+
Copyright (c) 2010-2015 SpryMedia Limited
4+
http://datatables.net
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# FixedColumns
2+
3+
When making use of DataTables' x-axis scrolling feature (`scrollX`), you may wish to fix the left or right most columns in place. This extension for DataTables provides exactly this option (for non-scrolling tables, please use the FixedHeader extension, which can fix the header and footer).
4+
5+
6+
# Installation
7+
8+
To use FixedColumns the best way to obtain the software is to use the [DataTables downloader](//datatables.net/download). You can also include the individual files from the [DataTables CDN](//cdn.datatables.net). See the [documentation](http://datatables.net/extensions/fixedcolumns/) for full details.
9+
10+
11+
# Basic usage
12+
13+
FixedColumns is initialised using the `fixedColumns` option in the DataTables constructor - a simple boolean `true` will enable the feature. Further options can be specified using this option as an object - see the documentation for details. DataTables' scrolling options should also be enabled to use this feature.
14+
15+
Example:
16+
17+
```js
18+
$(document).ready(function() {
19+
var table = $('#example').DataTable( {
20+
scrollY: "300px",
21+
scrollX: true,
22+
scrollCollapse: true,
23+
paging: false,
24+
fixedColumns: true
25+
} );
26+
} );
27+
```
28+
29+
30+
# Documentation / support
31+
32+
* [Documentation](https://datatables.net/extensions/fixedcolumns/)
33+
* [DataTables support forums](http://datatables.net/forums)
34+
35+
36+
# GitHub
37+
38+
If you fancy getting involved with the development of FixedColumns and help make it better, please refer to its [GitHub repo](https://github.com/DataTables/FixedColumns).

vendor/datatables-fixedcolumns/Readme.txt

Lines changed: 0 additions & 42 deletions
This file was deleted.

vendor/datatables-fixedcolumns/bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "datatables-fixedcolumns",
3-
"version": "3.0.2",
3+
"version": "3.1.0",
44
"main": [
55
"js/dataTables.fixedColumns.js",
6-
"css/dataTables.fixedColumns.css"
6+
"css/fixedColumns.dataTables.scss"
77
],
88
"dependencies": {
99
"jquery": ">=1.7.0",

vendor/datatables-fixedcolumns/css/dataTables.fixedColumns.css

Lines changed: 8 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
table.DTFC_Cloned tr.even {
3+
background-color: white;
4+
margin-bottom: 0;
5+
}
6+
7+
div.DTFC_LeftHeadWrapper table,
8+
div.DTFC_RightHeadWrapper table {
9+
border-bottom: none !important;
10+
margin-bottom: 0 !important;
11+
background-color: white;
12+
}
13+
14+
div.DTFC_LeftBodyWrapper table,
15+
div.DTFC_RightBodyWrapper table {
16+
border-top: none;
17+
margin: 0 !important;
18+
19+
// Hide sorting icons
20+
thead {
21+
.sorting:after,
22+
.sorting_asc:after,
23+
.sorting_desc:after,
24+
.sorting:after,
25+
.sorting_asc:after,
26+
.sorting_desc:after {
27+
display: none;
28+
}
29+
}
30+
31+
// Header provides the border
32+
tbody tr:first-child {
33+
th,
34+
td {
35+
border-top: none;
36+
}
37+
}
38+
}
39+
40+
div.DTFC_LeftFootWrapper table,
41+
div.DTFC_RightFootWrapper table {
42+
border-top: none;
43+
margin-top: 0 !important;
44+
background-color: white;
45+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
// Block out what is behind the fixed column's header and footer
3+
table.DTFC_Cloned thead,
4+
table.DTFC_Cloned tfoot {
5+
background-color: white;
6+
}
7+
8+
// Block out the gap above the scrollbar on the right, when there is a fixed
9+
// right column
10+
div.DTFC_Blocker {
11+
background-color: white;
12+
}
13+
14+
div.DTFC_LeftWrapper table.dataTable,
15+
div.DTFC_RightWrapper table.dataTable {
16+
margin-bottom: 0;
17+
z-index: 2;
18+
19+
&.no-footer {
20+
border-bottom: none;
21+
}
22+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
3+
div.DTFC_LeftHeadWrapper table,
4+
div.DTFC_LeftBodyWrapper table,
5+
div.DTFC_LeftFootWrapper table {
6+
border-right-width: 0;
7+
}
8+
9+
div.DTFC_RightHeadWrapper table,
10+
div.DTFC_RightBodyWrapper table,
11+
div.DTFC_RightFootWrapper table {
12+
border-left-width: 0;
13+
}
14+
15+
div.DTFC_LeftHeadWrapper table,
16+
div.DTFC_RightHeadWrapper table {
17+
margin-bottom: 0 !important;
18+
}
19+
20+
div.DTFC_LeftBodyWrapper table,
21+
div.DTFC_RightBodyWrapper table {
22+
border-top: none;
23+
margin: 0 !important;
24+
}
25+
26+
div.DTFC_LeftFootWrapper table,
27+
div.DTFC_RightFootWrapper table {
28+
margin-top: 0 !important;
29+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
div.DTFC_LeftWrapper table.dataTable,
3+
div.DTFC_RightWrapper table.dataTable {
4+
z-index: 2;
5+
6+
&.no-footer {
7+
border-bottom: none;
8+
}
9+
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)