Skip to content

Commit

Permalink
allow table to have id
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed Jul 11, 2019
1 parent 96b6b83 commit 75c598b
Show file tree
Hide file tree
Showing 9 changed files with 1,090 additions and 1,038 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ Since it's a wrapper, all/most features are provided by the [jQuery DataTables](
Our component parameters:
```javascript
props: {
/**
* The table id - useful for saveState
*
* @type String
*/
id: {
type: String
},
/**
* Set the table classes you wish to use, default with bootstrap4
* but you can override with: themeforest, foundation, etc..
Expand Down
34 changes: 27 additions & 7 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("jQuery"), require("Vue"));
module.exports = factory(require("Vue"), require("jQuery"));
else if(typeof define === 'function' && define.amd)
define("VdtnetTable", ["jQuery", "Vue"], factory);
define("VdtnetTable", ["Vue", "jQuery"], factory);
else if(typeof exports === 'object')
exports["VdtnetTable"] = factory(require("jQuery"), require("Vue"));
exports["VdtnetTable"] = factory(require("Vue"), require("jQuery"));
else
root["VdtnetTable"] = factory(root["jQuery"], root["Vue"]);
})(window, function(__WEBPACK_EXTERNAL_MODULE_jquery__, __WEBPACK_EXTERNAL_MODULE_vue__) {
root["VdtnetTable"] = factory(root["Vue"], root["jQuery"]);
})(window, function(__WEBPACK_EXTERNAL_MODULE_vue__, __WEBPACK_EXTERNAL_MODULE_jquery__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
Expand Down Expand Up @@ -435,9 +435,21 @@ __webpack_require__.r(__webpack_exports__);
//
//
//
//
var myUniqueId = 1;
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'VdtnetTable',
props: {
/**
* The table id
*
* @type String
*/
id: {
type: String,
"default": null
},

/**
* Set the table classes you wish to use, default with bootstrap4
* but you can override with: themeforest, foundation, etc..
Expand Down Expand Up @@ -558,6 +570,10 @@ __webpack_require__.r(__webpack_exports__);

if (vm.opts) {
vm.options = jq.extend({}, vm.options, vm.opts);
}

if (!vm.id) {
vm.id = "vdtnetable".concat(myUniqueId++);
} // if fields are passed in, generate column definition
// from our custom fields schema

Expand Down Expand Up @@ -22145,7 +22161,11 @@ var staticRenderFns = [
var _c = _vm._self._c || _h
return _c(
"table",
{ ref: "table", class: _vm.className, attrs: { cellpadding: "0" } },
{
ref: "table",
class: _vm.className,
attrs: { id: _vm.id, cellpadding: "0" }
},
[
_c("thead", [
_c(
Expand Down Expand Up @@ -22397,7 +22417,7 @@ __webpack_require__.r(__webpack_exports__);
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

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


/***/ }),
Expand Down
2 changes: 1 addition & 1 deletion example/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/index.js": "/index.js?id=37336752df717b9324d7",
"/index.js.map": "/index.js.map?id=c83eba6d7c52c25f97e5"
"/index.js": "/index.js?id=dafe225e8d281da0e24b",
"/index.js.map": "/index.js.map?id=410a06bf061a383bed6a"
}
Loading

0 comments on commit 75c598b

Please sign in to comment.