Skip to content

Commit 75c598b

Browse files
committed
allow table to have id
1 parent 96b6b83 commit 75c598b

File tree

9 files changed

+1090
-1038
lines changed

9 files changed

+1090
-1038
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ Since it's a wrapper, all/most features are provided by the [jQuery DataTables](
9898
Our component parameters:
9999
```javascript
100100
props: {
101+
/**
102+
* The table id - useful for saveState
103+
*
104+
* @type String
105+
*/
106+
id: {
107+
type: String
108+
},
101109
/**
102110
* Set the table classes you wish to use, default with bootstrap4
103111
* but you can override with: themeforest, foundation, etc..

example/index.js

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
(function webpackUniversalModuleDefinition(root, factory) {
22
if(typeof exports === 'object' && typeof module === 'object')
3-
module.exports = factory(require("jQuery"), require("Vue"));
3+
module.exports = factory(require("Vue"), require("jQuery"));
44
else if(typeof define === 'function' && define.amd)
5-
define("VdtnetTable", ["jQuery", "Vue"], factory);
5+
define("VdtnetTable", ["Vue", "jQuery"], factory);
66
else if(typeof exports === 'object')
7-
exports["VdtnetTable"] = factory(require("jQuery"), require("Vue"));
7+
exports["VdtnetTable"] = factory(require("Vue"), require("jQuery"));
88
else
9-
root["VdtnetTable"] = factory(root["jQuery"], root["Vue"]);
10-
})(window, function(__WEBPACK_EXTERNAL_MODULE_jquery__, __WEBPACK_EXTERNAL_MODULE_vue__) {
9+
root["VdtnetTable"] = factory(root["Vue"], root["jQuery"]);
10+
})(window, function(__WEBPACK_EXTERNAL_MODULE_vue__, __WEBPACK_EXTERNAL_MODULE_jquery__) {
1111
return /******/ (function(modules) { // webpackBootstrap
1212
/******/ // The module cache
1313
/******/ var installedModules = {};
@@ -435,9 +435,21 @@ __webpack_require__.r(__webpack_exports__);
435435
//
436436
//
437437
//
438+
//
439+
var myUniqueId = 1;
438440
/* harmony default export */ __webpack_exports__["default"] = ({
439441
name: 'VdtnetTable',
440442
props: {
443+
/**
444+
* The table id
445+
*
446+
* @type String
447+
*/
448+
id: {
449+
type: String,
450+
"default": null
451+
},
452+
441453
/**
442454
* Set the table classes you wish to use, default with bootstrap4
443455
* but you can override with: themeforest, foundation, etc..
@@ -558,6 +570,10 @@ __webpack_require__.r(__webpack_exports__);
558570

559571
if (vm.opts) {
560572
vm.options = jq.extend({}, vm.options, vm.opts);
573+
}
574+
575+
if (!vm.id) {
576+
vm.id = "vdtnetable".concat(myUniqueId++);
561577
} // if fields are passed in, generate column definition
562578
// from our custom fields schema
563579

@@ -22145,7 +22161,11 @@ var staticRenderFns = [
2214522161
var _c = _vm._self._c || _h
2214622162
return _c(
2214722163
"table",
22148-
{ ref: "table", class: _vm.className, attrs: { cellpadding: "0" } },
22164+
{
22165+
ref: "table",
22166+
class: _vm.className,
22167+
attrs: { id: _vm.id, cellpadding: "0" }
22168+
},
2214922169
[
2215022170
_c("thead", [
2215122171
_c(
@@ -22397,7 +22417,7 @@ __webpack_require__.r(__webpack_exports__);
2239722417
/*! no static exports found */
2239822418
/***/ (function(module, exports, __webpack_require__) {
2239922419

22400-
module.exports = __webpack_require__(/*! /Users/tomn/Desktop/work/niiknow/vue-datatables-net/example/app.js */"./example/app.js");
22420+
module.exports = __webpack_require__(/*! /Users/tech/Desktop/work/niiknow/vue-datatables-net/example/app.js */"./example/app.js");
2240122421

2240222422

2240322423
/***/ }),

example/index.js.map

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

lib/index.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.

lib/index.js.map

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

lib/mix-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"/index.js": "/index.js?id=37336752df717b9324d7",
3-
"/index.js.map": "/index.js.map?id=c83eba6d7c52c25f97e5"
2+
"/index.js": "/index.js?id=dafe225e8d281da0e24b",
3+
"/index.js.map": "/index.js.map?id=410a06bf061a383bed6a"
44
}

0 commit comments

Comments
 (0)