|
@@ -712,7 +712,7 @@ class TableAjax extends ViewAjax {
|
|
|
if (!_body) {
|
|
if (!_body) {
|
|
|
_uiNode$Table.find('tbody').remove();
|
|
_uiNode$Table.find('tbody').remove();
|
|
|
_body = $('<tbody></tbody>').insertAfter(_head);
|
|
_body = $('<tbody></tbody>').insertAfter(_head);
|
|
|
- _body.on('change', '.unique', priv.rowChecked);
|
|
|
|
|
|
|
+ //_body.on('change', '.unique', priv.rowChecked);
|
|
|
|
|
|
|
|
//find out what rows to show next...
|
|
//find out what rows to show next...
|
|
|
var rowsAdded = 0;
|
|
var rowsAdded = 0;
|
|
@@ -917,35 +917,15 @@ class TableAjax extends ViewAjax {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- if (_currPage == 1) {
|
|
|
|
|
|
|
+ if (_state.page == 1) {
|
|
|
_totalPages = Math.ceil(_data.total / priv.options.pageSize);
|
|
_totalPages = Math.ceil(_data.total / priv.options.pageSize);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//pad with empty rows if we're at last page.
|
|
//pad with empty rows if we're at last page.
|
|
|
- if (_currPage == _totalPages) {
|
|
|
|
|
|
|
+ if (_state.page == _totalPages) {
|
|
|
while (rowsAdded < priv.options.pageSize) {
|
|
while (rowsAdded < priv.options.pageSize) {
|
|
|
- var row = $('<tr></tr>').appendTo(_body);
|
|
|
|
|
-
|
|
|
|
|
- if (_state.uniqueCol && priv.options.checkboxes) {
|
|
|
|
|
- var cell = $('<td></td>').appendTo(row);
|
|
|
|
|
- $('<input disabled type="checkbox" />').appendTo(cell);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (priv.options.rowFunctions || priv.options.filtersClean) {
|
|
|
|
|
- $('<td class="text-right stickyCol1"> </td>').appendTo(row);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- var i = 0;
|
|
|
|
|
- $.each(_data.cols, function (column, props) {
|
|
|
|
|
- i++;
|
|
|
|
|
- if (props.hidden) return;
|
|
|
|
|
-
|
|
|
|
|
- if (i == 1) {
|
|
|
|
|
- $('<td class="stickyCol2"> </td>').appendTo(row);
|
|
|
|
|
- } else {
|
|
|
|
|
- $('<td> </td>').appendTo(row);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ var rowNode = priv.renderRowEmptyNode();
|
|
|
|
|
+ if (rowNode) rowNode.appendTo(_body);
|
|
|
rowsAdded++;
|
|
rowsAdded++;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -995,6 +975,32 @@ class TableAjax extends ViewAjax {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ priv.renderRowEmptyNode = function() {
|
|
|
|
|
+ var row = $('<tr></tr>');
|
|
|
|
|
+ if (_state.uniqueCol && priv.options.checkboxes) {
|
|
|
|
|
+ var cell = $('<td></td>').appendTo(row);
|
|
|
|
|
+ $('<input disabled type="checkbox" />').appendTo(cell);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (priv.options.rowFunctions || priv.options.filtersClean) {
|
|
|
|
|
+ $('<td class="text-right stickyCol1"> </td>').appendTo(row);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (var i = 0; i < _state.colsSorted.length; i++) {
|
|
|
|
|
+ var key = _state.colsSorted[i];
|
|
|
|
|
+ if (!_data.cols[key]) return;
|
|
|
|
|
+ var props = _data.cols[key];
|
|
|
|
|
+ if (props.hidden) continue;
|
|
|
|
|
+
|
|
|
|
|
+ if (i == 1) {
|
|
|
|
|
+ $('<td class="stickyCol2"> </td>').appendTo(row);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('<td> </td>').appendTo(row);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return row;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
priv.renderTableTheadSort = function() {
|
|
priv.renderTableTheadSort = function() {
|
|
|
var nodeClass = 'tblAjax__' + 'head__sort',
|
|
var nodeClass = 'tblAjax__' + 'head__sort',
|
|
|
currentNode = _uiNode$Table.find('thead').find('.' + nodeClass),
|
|
currentNode = _uiNode$Table.find('thead').find('.' + nodeClass),
|