Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
 - Add original index to props.row
 - conserve original row order
  • Loading branch information
xaksis committed Aug 10, 2017
1 parent c0aa186 commit cd81377
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 20 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ This should result in the screenshot seen above
</template>
</vue-good-table>
```
In addition to `prop.row` that contains the row object, `prop.index` contains the index for the table display row. And `prop.row.originalIndex` contains the original row index. You can access the original row object by using `row[prop.row.originalIndex]`.

### Component Options

Expand Down
2 changes: 1 addition & 1 deletion dist/stats.json

Large diffs are not rendered by default.

65 changes: 48 additions & 17 deletions dist/vue-good-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
computedRows = filteredRows;
}

if (this.sortable !== false && (this.searchTrigger != 'enter' || this.sortChanged)) {
if (this.sortable !== false && this.sortColumn !== -1 && (this.searchTrigger != 'enter' || this.sortChanged)) {

this.sortChanged = false;

Expand Down Expand Up @@ -1380,42 +1380,73 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

mounted: function mounted() {
this.filteredRows = JSON.parse(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_core_js_json_stringify___default()(this.rows));

var _iteratorNormalCompletion5 = true;
var _didIteratorError5 = false;
var _iteratorError5 = undefined;

try {
for (var _iterator5 = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_get_iterator___default()(this.filteredRows.entries()), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
var _ref = _step5.value;

var _ref2 = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray___default()(_ref, 2);

var index = _ref2[0];
var row = _ref2[1];

row.originalIndex = index;
}
} catch (err) {
_didIteratorError5 = true;
_iteratorError5 = err;
} finally {
try {
if (!_iteratorNormalCompletion5 && _iterator5.return) {
_iterator5.return();
}
} finally {
if (_didIteratorError5) {
throw _iteratorError5;
}
}
}

if (this.perPage) {
this.currentPerPage = this.perPage;
}

if (this.defaultSortBy) {
var _iteratorNormalCompletion5 = true;
var _didIteratorError5 = false;
var _iteratorError5 = undefined;
var _iteratorNormalCompletion6 = true;
var _didIteratorError6 = false;
var _iteratorError6 = undefined;

try {
for (var _iterator5 = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_get_iterator___default()(this.columns.entries()), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
var _ref = _step5.value;
for (var _iterator6 = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_get_iterator___default()(this.columns.entries()), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
var _ref3 = _step6.value;

var _ref2 = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray___default()(_ref, 2);
var _ref4 = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_slicedToArray___default()(_ref3, 2);

var index = _ref2[0];
var col = _ref2[1];
var _index = _ref4[0];
var col = _ref4[1];

if (col.field === this.defaultSortBy.field) {
this.sortColumn = index;
this.sortColumn = _index;
this.sortType = this.defaultSortBy.type || 'asc';
this.sortChanged = true;
break;
}
}
} catch (err) {
_didIteratorError5 = true;
_iteratorError5 = err;
_didIteratorError6 = true;
_iteratorError6 = err;
} finally {
try {
if (!_iteratorNormalCompletion5 && _iterator5.return) {
_iterator5.return();
if (!_iteratorNormalCompletion6 && _iterator6.return) {
_iterator6.return();
}
} finally {
if (_didIteratorError5) {
throw _iteratorError5;
if (_didIteratorError6) {
throw _iteratorError6;
}
}
}
Expand Down Expand Up @@ -2014,7 +2045,7 @@ exports = module.exports = __webpack_require__(67)(false);


// module
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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}\n.left-align[data-v-d89f00e8]{\n text-align: left;\n}\n.pull-left[data-v-d89f00e8]{\n float: left !important;\n}\n.pull-right[data-v-d89f00e8]{\n float: right !important;\n}\n.clearfix[data-v-d89f00e8]::after {\n display: block;\n content: \"\";\n clear: both;\n}\n\n/* Table specific styles\n************************************************/\ntable[data-v-d89f00e8]{\n border-collapse: collapse;\n background-color: transparent;\n margin-bottom: 0px;\n}\n.table[data-v-d89f00e8]{\n width: 100%;\n max-width: 100%;\n}\n.table.table-striped tbody tr[data-v-d89f00e8]:nth-of-type(odd) {\n background-color: rgba(35,41,53,.05);\n}\n.table.table-bordered td[data-v-d89f00e8], .table-bordered th[data-v-d89f00e8] {\n border: 1px solid #DDD;\n}\n.table td[data-v-d89f00e8], .table th[data-v-d89f00e8]:not(.line-numbers) {\n padding: .75rem 1.5rem .75rem .75rem;\n vertical-align: top;\n border-top: 1px solid #ddd;\n}\n.table.condensed td[data-v-d89f00e8], .table.condensed th[data-v-d89f00e8] {\n padding: .4rem .4rem .4rem .4rem;\n}\n.table thead th[data-v-d89f00e8], .table.condensed thead th[data-v-d89f00e8] {\n vertical-align: bottom;\n border-bottom: 2px solid #ddd;\n padding-right: 1.5rem;\n background-color: rgba(35,41,53,0.03);\n}\ntr.clickable[data-v-d89f00e8] {\n cursor: pointer;\n}\n.table input[data-v-d89f00e8]{\n display: block;\n width: calc(100% - 24px);\n height: 34px;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555;\n background-color: #fff;\n background-image: none;\n border: 1px solid #ccc;\n border-radius: 4px;\n box-shadow: inset 0 1px 1px rgba(35,41,53,.075);\n transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;\n}\ntable th.sorting-asc[data-v-d89f00e8],\n table th.sorting-desc[data-v-d89f00e8] {\n color: rgba(0, 0, 0, 0.66);\n position: relative;\n}\ntable th.sorting[data-v-d89f00e8]:after,\n table th.sorting-asc[data-v-d89f00e8]:after {\n font-family: 'Material Icons';\n position: absolute;\n height: 0px;\n width: 0px;\n content: '';\n display: none;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid rgba(0, 0, 0, 0.66);\n margin-top: 6px;\n margin-left: 5px;\n}\ntable th.sorting[data-v-d89f00e8]:hover:after{\n display: inline-block;\n border-bottom-color: rgba(35,41,53,0.25);\n}\ntable th.sorting-asc[data-v-d89f00e8]:after,\n table th.sorting-desc[data-v-d89f00e8]:after {\n display: inline-block;\n}\ntable th.sorting-desc[data-v-d89f00e8]:after {\n border-top: 6px solid rgba(0, 0, 0, 0.66);\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: none;\n margin-top: 8px;\n}\n.responsive[data-v-d89f00e8] {\n width: 100%;\n overflow-x: scroll;\n}\n\n/* Table header specific styles\n************************************************/\n.table-header[data-v-d89f00e8]{\n padding: .75rem;\n}\n.table-header .table-title[data-v-d89f00e8]{\n margin: 0px;\n font-size: 18px;\n}\n\n\n/* Table footer specific styles\n************************************************/\n.table-footer[data-v-d89f00e8]{\n /* background-color: rgba(35,41,53, 0.03); */\n background-color: rgba(35,41,53,0.05);\n border: 1px solid #DDD;\n margin-bottom: 2rem;\n margin-top: 0px;\n padding: 1rem;\n border-bottom-right-radius: 5px;\n border-bottom-left-radius: 5px;\n font-size: 14px;\n color: rgba(0, 0, 0, 0.44);\n}\n.table-footer>div[data-v-d89f00e8]{\n display: inline-block;\n}\n.pagination-controls>*[data-v-d89f00e8]{\n display: inline-block;\n}\n.pagination-controls a[data-v-d89f00e8]{\n text-decoration: none;\n color: rgba(0, 0, 0, 0.66);\n font-size: 14px;\n font-weight: 600;\n opacity: 0.8;\n}\n.pagination-controls a[data-v-d89f00e8]:hover{\n opacity: 1;\n}\n.pagination-controls a span[data-v-d89f00e8]{\n display: inline-block;\n vertical-align: middle;\n}\n.pagination-controls .info[data-v-d89f00e8]{\n margin: 0px 15px;\n font-size: 13px;\n font-weight: bold;\n color: rgba(0, 0, 0, 0.40);\n}\n.pagination-controls a .chevron[data-v-d89f00e8]{\n width: 24px;\n height: 24px;\n border-radius: 15%;\n /* border: 1px solid rgba(35,41,53,0.2);\n background-color: #fff; */\n position: relative;\n margin: 0px 8px;\n}\n.pagination-controls .chevron[data-v-d89f00e8]::after{\n content: '';\n position: absolute;\n display: block;\n left: 50%;\n top: 50%;\n margin-top: -6px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n}\n.pagination-controls .chevron.left[data-v-d89f00e8]::after{\n border-right: 6px solid rgba(0, 0, 0, 0.66);\n margin-left: -3px;\n}\n.pagination-controls .chevron.right[data-v-d89f00e8]::after{\n border-left: 6px solid rgba(0, 0, 0, 0.66);\n margin-left: -3px;\n}\n.table-footer select[data-v-d89f00e8] {\n display: inline-block;\n background-color: transparent;\n width: auto;\n padding: 0;\n border: 0;\n border-radius: 0;\n height: auto;\n font-size: 14px;\n margin-left: 8px;\n color: rgba(0, 0, 0, 0.55);\n font-weight: bold;\n}\n.table-footer .perpage-count[data-v-d89f00e8]{\n color: rgba(0, 0, 0, 0.55);\n font-weight: bold;\n}\n@media only screen and (max-width: 750px) {\n /* on small screens hide the info */\n.pagination-controls .info[data-v-d89f00e8]{\n display: none;\n}\n}\n\n /* Global Search\n **********************************************/\n.global-search[data-v-d89f00e8]{\n position: relative;\n padding-left: 40px;\n}\n.global-search-icon[data-v-d89f00e8]{\n position: absolute;\n left: 0px;\n max-width: 32px;\n}\n.global-search-icon > img[data-v-d89f00e8]{\n max-width: 100%;\n margin-top: 8px;\n opacity: 0.5;\n}\ntable .global-search-input[data-v-d89f00e8]{\n width: calc(100% - 30px);\n}\n\n /* Line numbers\n **********************************************/\ntable th.line-numbers[data-v-d89f00e8], .table.condensed th.line-numbers[data-v-d89f00e8]{\n background-color: rgba(35,41,53,0.05);\n padding-left: 3px;\n padding-right: 3px;\n word-wrap: break-word;\n width: 45px;\n text-align: center;\n}\n\n", ""]);
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n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-align[data-v-d89f00e8]{\n text-align: right;\n}\n.left-align[data-v-d89f00e8]{\n text-align: left;\n}\n.pull-left[data-v-d89f00e8]{\n float: left !important;\n}\n.pull-right[data-v-d89f00e8]{\n float: right !important;\n}\n.clearfix[data-v-d89f00e8]::after {\n display: block;\n content: \"\";\n clear: both;\n}\n\n/* Table specific styles\n************************************************/\ntable[data-v-d89f00e8]{\n border-collapse: collapse;\n background-color: transparent;\n margin-bottom: 0px;\n}\n.table[data-v-d89f00e8]{\n width: 100%;\n max-width: 100%;\n}\n.table.table-striped tbody tr[data-v-d89f00e8]:nth-of-type(odd) {\n background-color: rgba(35,41,53,.05);\n}\n.table.table-bordered td[data-v-d89f00e8], .table-bordered th[data-v-d89f00e8] {\n border: 1px solid #DDD;\n}\n.table td[data-v-d89f00e8], .table th[data-v-d89f00e8]:not(.line-numbers) {\n padding: .75rem 1.5rem .75rem .75rem;\n vertical-align: top;\n border-top: 1px solid #ddd;\n}\n.table.condensed td[data-v-d89f00e8], .table.condensed th[data-v-d89f00e8] {\n padding: .4rem .4rem .4rem .4rem;\n}\n.table thead th[data-v-d89f00e8], .table.condensed thead th[data-v-d89f00e8] {\n vertical-align: bottom;\n border-bottom: 2px solid #ddd;\n padding-right: 1.5rem;\n background-color: rgba(35,41,53,0.03);\n}\ntr.clickable[data-v-d89f00e8] {\n cursor: pointer;\n}\n.table input[data-v-d89f00e8]{\n display: block;\n width: calc(100% - 24px);\n height: 34px;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555;\n background-color: #fff;\n background-image: none;\n border: 1px solid #ccc;\n border-radius: 4px;\n box-shadow: inset 0 1px 1px rgba(35,41,53,.075);\n transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;\n}\ntable th.sorting-asc[data-v-d89f00e8],\n table th.sorting-desc[data-v-d89f00e8] {\n color: rgba(0, 0, 0, 0.66);\n position: relative;\n}\ntable th.sorting[data-v-d89f00e8]:after,\n table th.sorting-asc[data-v-d89f00e8]:after {\n font-family: 'Material Icons';\n position: absolute;\n height: 0px;\n width: 0px;\n content: '';\n display: none;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid rgba(0, 0, 0, 0.66);\n margin-top: 6px;\n margin-left: 5px;\n}\ntable th.sorting[data-v-d89f00e8]:hover:after{\n display: inline-block;\n border-bottom-color: rgba(35,41,53,0.25);\n}\ntable th.sorting-asc[data-v-d89f00e8]:after,\n table th.sorting-desc[data-v-d89f00e8]:after {\n display: inline-block;\n}\ntable th.sorting-desc[data-v-d89f00e8]:after {\n border-top: 6px solid rgba(0, 0, 0, 0.66);\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: none;\n margin-top: 8px;\n}\n.responsive[data-v-d89f00e8] {\n width: 100%;\n overflow-x: scroll;\n}\n\n/* Table header specific styles\n************************************************/\n.table-header[data-v-d89f00e8]{\n padding: .75rem;\n}\n.table-header .table-title[data-v-d89f00e8]{\n margin: 0px;\n font-size: 18px;\n}\n\n\n/* Table footer specific styles\n************************************************/\n.table-footer[data-v-d89f00e8]{\n /* background-color: rgba(35,41,53, 0.03); */\n background-color: rgba(35,41,53,0.05);\n border: 1px solid #DDD;\n margin-bottom: 2rem;\n margin-top: 0px;\n padding: 1rem;\n border-bottom-right-radius: 5px;\n border-bottom-left-radius: 5px;\n font-size: 14px;\n color: rgba(0, 0, 0, 0.44);\n}\n.table-footer>div[data-v-d89f00e8]{\n display: inline-block;\n}\n.pagination-controls>*[data-v-d89f00e8]{\n display: inline-block;\n}\n.pagination-controls a[data-v-d89f00e8]{\n text-decoration: none;\n color: rgba(0, 0, 0, 0.66);\n font-size: 14px;\n font-weight: 600;\n opacity: 0.8;\n}\n.pagination-controls a[data-v-d89f00e8]:hover{\n opacity: 1;\n}\n.pagination-controls a span[data-v-d89f00e8]{\n display: inline-block;\n vertical-align: middle;\n}\n.pagination-controls .info[data-v-d89f00e8]{\n margin: 0px 15px;\n font-size: 13px;\n font-weight: bold;\n color: rgba(0, 0, 0, 0.40);\n}\n.pagination-controls a .chevron[data-v-d89f00e8]{\n width: 24px;\n height: 24px;\n border-radius: 15%;\n /* border: 1px solid rgba(35,41,53,0.2);\n background-color: #fff; */\n position: relative;\n margin: 0px 8px;\n}\n.pagination-controls .chevron[data-v-d89f00e8]::after{\n content: '';\n position: absolute;\n display: block;\n left: 50%;\n top: 50%;\n margin-top: -6px;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n}\n.pagination-controls .chevron.left[data-v-d89f00e8]::after{\n border-right: 6px solid rgba(0, 0, 0, 0.66);\n margin-left: -3px;\n}\n.pagination-controls .chevron.right[data-v-d89f00e8]::after{\n border-left: 6px solid rgba(0, 0, 0, 0.66);\n margin-left: -3px;\n}\n.table-footer select[data-v-d89f00e8] {\n display: inline-block;\n background-color: transparent;\n width: auto;\n padding: 0;\n border: 0;\n border-radius: 0;\n height: auto;\n font-size: 14px;\n margin-left: 8px;\n color: rgba(0, 0, 0, 0.55);\n font-weight: bold;\n}\n.table-footer .perpage-count[data-v-d89f00e8]{\n color: rgba(0, 0, 0, 0.55);\n font-weight: bold;\n}\n@media only screen and (max-width: 750px) {\n /* on small screens hide the info */\n.pagination-controls .info[data-v-d89f00e8]{\n display: none;\n}\n}\n\n /* Global Search\n **********************************************/\n.global-search[data-v-d89f00e8]{\n position: relative;\n padding-left: 40px;\n}\n.global-search-icon[data-v-d89f00e8]{\n position: absolute;\n left: 0px;\n max-width: 32px;\n}\n.global-search-icon > img[data-v-d89f00e8]{\n max-width: 100%;\n margin-top: 8px;\n opacity: 0.5;\n}\ntable .global-search-input[data-v-d89f00e8]{\n width: calc(100% - 30px);\n}\n\n /* Line numbers\n **********************************************/\ntable th.line-numbers[data-v-d89f00e8], .table.condensed th.line-numbers[data-v-d89f00e8]{\n background-color: rgba(35,41,53,0.05);\n padding-left: 3px;\n padding-right: 3px;\n word-wrap: break-word;\n width: 45px;\n text-align: center;\n}\n\n", ""]);

// exports

Expand Down
2 changes: 1 addition & 1 deletion dist/vue-good-table.min.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ import format from 'date-fns/format';
}
//taking care of sort here only if sort has changed
if (this.sortable !== false &&
if (this.sortable !== false && this.sortColumn !== -1 &&
// if search trigger is enter then we only sort
// when enter is hit
Expand Down Expand Up @@ -492,6 +492,12 @@ import format from 'date-fns/format';
mounted() {
this.filteredRows = JSON.parse(JSON.stringify(this.rows));
// we need to preserve the original index of rows so lets do that
for(const [index, row] of this.filteredRows.entries()) {
row.originalIndex = index;
}
if (this.perPage) {
this.currentPerPage = this.perPage;
}
Expand Down

0 comments on commit cd81377

Please sign in to comment.