jqgrid_utils 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/.hidden +0 -0
- package/dist/jqgrid_utils.js +35 -0
- package/jqgrid_utils.js +31 -0
- package/make.sh +1 -0
- package/package.json +24 -0
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Vanilla - website - utils
|
|
2
|
+
Convenient Functions for free jqGrid
|
|
3
|
+
|
|
4
|
+
Demo:
|
|
5
|
+
https://jqgrid_utils.calantas.org
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Example Usage:
|
|
9
|
+
|
|
10
|
+
Add a the library to your website
|
|
11
|
+
|
|
12
|
+
``
|
|
13
|
+
`html
|
|
14
|
+
<script src="../node_modules/jqgrid_utils/dist/jqgrid_utils.js"></script>
|
|
15
|
+
`
|
|
16
|
+
``
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
Example Usage:
|
|
20
|
+
```javascript
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Discover All Functions:
|
|
25
|
+
|
|
26
|
+
* To add the Qty of rows to the Caption text
|
|
27
|
+
* grid_set_captain(_grid, data)
|
|
28
|
+
* _grid: the DOM ID of grid(type: string), example: '#grid'
|
|
29
|
+
* data: the grid data(type: array) (Optional)
|
|
30
|
+
* example:
|
|
31
|
+
```javascript
|
|
32
|
+
let gu = new Jqgrid_utils();
|
|
33
|
+
loadComplete: function(data)
|
|
34
|
+
{
|
|
35
|
+
await gu.grid_set_captain(_grid, data);
|
|
36
|
+
}
|
|
37
|
+
```
|
package/dist/.hidden
ADDED
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Jqgrid_utils = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
module.exports = class Vanilla_website_utils
|
|
5
|
+
{
|
|
6
|
+
|
|
7
|
+
constructor()
|
|
8
|
+
{}
|
|
9
|
+
|
|
10
|
+
s_grid_set_captain(_grid, data=[])
|
|
11
|
+
{
|
|
12
|
+
this.grid_set_captain(_grid, data=[]);
|
|
13
|
+
}
|
|
14
|
+
async grid_set_captain(_grid, data=[])
|
|
15
|
+
{
|
|
16
|
+
const grid = jQuery(_grid);
|
|
17
|
+
if(data.length ===0)
|
|
18
|
+
{
|
|
19
|
+
data = grid.jqGrid('getRowData');
|
|
20
|
+
console.log(data);
|
|
21
|
+
}
|
|
22
|
+
let caption = grid.jqGrid("getGridParam", "caption");
|
|
23
|
+
if (Array.isArray(data))
|
|
24
|
+
{
|
|
25
|
+
grid.jqGrid('setCaption', caption + ' - ' + data.length + 'x');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
},{}]},{},[1])(1)
|
|
35
|
+
});
|
package/jqgrid_utils.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = class Vanilla_website_utils
|
|
4
|
+
{
|
|
5
|
+
|
|
6
|
+
constructor()
|
|
7
|
+
{}
|
|
8
|
+
|
|
9
|
+
s_grid_set_captain(_grid, data=[])
|
|
10
|
+
{
|
|
11
|
+
this.grid_set_captain(_grid, data=[]);
|
|
12
|
+
}
|
|
13
|
+
async grid_set_captain(_grid, data=[])
|
|
14
|
+
{
|
|
15
|
+
const grid = jQuery(_grid);
|
|
16
|
+
if(data.length ===0)
|
|
17
|
+
{
|
|
18
|
+
data = grid.jqGrid('getRowData');
|
|
19
|
+
console.log(data);
|
|
20
|
+
}
|
|
21
|
+
let caption = grid.jqGrid("getGridParam", "caption");
|
|
22
|
+
if (Array.isArray(data))
|
|
23
|
+
{
|
|
24
|
+
grid.jqGrid('setCaption', caption + ' - ' + data.length + 'x');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
|
package/make.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
watchify jqgrid_utils.js --s Jqgrid_utils -o dist/jqgrid_utils.js -v
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author":
|
|
3
|
+
{
|
|
4
|
+
"name": "veto@myridia.com"
|
|
5
|
+
},
|
|
6
|
+
"dependencies":
|
|
7
|
+
{},
|
|
8
|
+
"deprecated": false,
|
|
9
|
+
"description": "Convenient Functions for free jqGrid",
|
|
10
|
+
"homepage": "https://calantas.org/jq_gridutils",
|
|
11
|
+
"license": "GPL-3.0-or-later",
|
|
12
|
+
"main": "jqgrid_utils.js",
|
|
13
|
+
"name": "jqgrid_utils",
|
|
14
|
+
"repository":
|
|
15
|
+
{
|
|
16
|
+
"type": "hg",
|
|
17
|
+
"url": "https://calantas.org/jqgrid_utils"
|
|
18
|
+
},
|
|
19
|
+
"scripts":
|
|
20
|
+
{
|
|
21
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
22
|
+
},
|
|
23
|
+
"version": "1.0.0"
|
|
24
|
+
}
|