jqgrid_utils 1.1.1 → 1.1.2
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/dist/jqgrid_utils.js +39 -17
- package/jqgrid_utils.js +39 -17
- package/make.sh +2 -0
- package/npmignore +2 -0
- package/package.json +3 -3
package/dist/jqgrid_utils.js
CHANGED
|
@@ -17,27 +17,49 @@ module.exports = class Vanilla_website_utils
|
|
|
17
17
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
async s_set_link(col_model, edit_field, url ,attr='')
|
|
21
|
+
{
|
|
22
|
+
this.set_link(col_model, edit_field, url ,attr);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
async set_link(col_model, edit_field, url ,attr='')
|
|
27
|
+
{
|
|
28
|
+
for(let i=0;i< col_model.length;i++)
|
|
21
29
|
{
|
|
22
|
-
|
|
30
|
+
if(col_model[i]['name'] === edit_field)
|
|
31
|
+
{
|
|
32
|
+
col_model[i]['formatter'] = function (cell_val,o)
|
|
33
|
+
{
|
|
34
|
+
return '<a class="gl" ' + attr + 'href="' + o.rowData[url] + '">'+ cell_val +'</a>';
|
|
35
|
+
};
|
|
36
|
+
}
|
|
23
37
|
}
|
|
24
|
-
|
|
38
|
+
return col_model;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
s_grid_set_captain(_grid, data=[])
|
|
43
|
+
{
|
|
44
|
+
this.grid_set_captain(_grid, data=[]);
|
|
45
|
+
}
|
|
46
|
+
async grid_set_captain(_grid, data=[])
|
|
47
|
+
{
|
|
48
|
+
const grid = jQuery(_grid);
|
|
49
|
+
let count = 0;
|
|
50
|
+
if(data.length === 0)
|
|
25
51
|
{
|
|
26
|
-
const grid = jQuery(_grid);
|
|
27
|
-
let count = 0;
|
|
28
|
-
if(data.length === 0)
|
|
29
|
-
{
|
|
30
52
|
count = grid.jqGrid('getGridParam', 'records');
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
{
|
|
56
|
+
count = data.length;
|
|
57
|
+
}
|
|
58
|
+
let caption = grid.jqGrid("getGridParam", "caption");
|
|
59
|
+
if(caption.indexOf(count+'x') === -1 )
|
|
60
|
+
{
|
|
61
|
+
grid.jqGrid('setCaption', caption + ' - ' + count + 'x');
|
|
62
|
+
}
|
|
41
63
|
}
|
|
42
64
|
|
|
43
65
|
|
package/jqgrid_utils.js
CHANGED
|
@@ -16,27 +16,49 @@ module.exports = class Vanilla_website_utils
|
|
|
16
16
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
async s_set_link(col_model, edit_field, url ,attr='')
|
|
20
|
+
{
|
|
21
|
+
this.set_link(col_model, edit_field, url ,attr);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
async set_link(col_model, edit_field, url ,attr='')
|
|
26
|
+
{
|
|
27
|
+
for(let i=0;i< col_model.length;i++)
|
|
20
28
|
{
|
|
21
|
-
|
|
29
|
+
if(col_model[i]['name'] === edit_field)
|
|
30
|
+
{
|
|
31
|
+
col_model[i]['formatter'] = function (cell_val,o)
|
|
32
|
+
{
|
|
33
|
+
return '<a class="gl" ' + attr + 'href="' + o.rowData[url] + '">'+ cell_val +'</a>';
|
|
34
|
+
};
|
|
35
|
+
}
|
|
22
36
|
}
|
|
23
|
-
|
|
37
|
+
return col_model;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
s_grid_set_captain(_grid, data=[])
|
|
42
|
+
{
|
|
43
|
+
this.grid_set_captain(_grid, data=[]);
|
|
44
|
+
}
|
|
45
|
+
async grid_set_captain(_grid, data=[])
|
|
46
|
+
{
|
|
47
|
+
const grid = jQuery(_grid);
|
|
48
|
+
let count = 0;
|
|
49
|
+
if(data.length === 0)
|
|
24
50
|
{
|
|
25
|
-
const grid = jQuery(_grid);
|
|
26
|
-
let count = 0;
|
|
27
|
-
if(data.length === 0)
|
|
28
|
-
{
|
|
29
51
|
count = grid.jqGrid('getGridParam', 'records');
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
}
|
|
53
|
+
else
|
|
54
|
+
{
|
|
55
|
+
count = data.length;
|
|
56
|
+
}
|
|
57
|
+
let caption = grid.jqGrid("getGridParam", "caption");
|
|
58
|
+
if(caption.indexOf(count+'x') === -1 )
|
|
59
|
+
{
|
|
60
|
+
grid.jqGrid('setCaption', caption + ' - ' + count + 'x');
|
|
61
|
+
}
|
|
40
62
|
}
|
|
41
63
|
|
|
42
64
|
|
package/make.sh
CHANGED
package/npmignore
ADDED
package/package.json
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"dependencies":
|
|
7
7
|
{},
|
|
8
8
|
"deprecated": false,
|
|
9
|
-
"description": "Convenient Functions for
|
|
10
|
-
"homepage": "
|
|
9
|
+
"description": "Convenient Functions for the Free jqGrid",
|
|
10
|
+
"homepage": "http://calantas.org/jqgrid_utils",
|
|
11
11
|
"license": "GPL-3.0-or-later",
|
|
12
12
|
"main": "jqgrid_utils.js",
|
|
13
13
|
"name": "jqgrid_utils",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
{
|
|
29
29
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
30
30
|
},
|
|
31
|
-
"version": "1.1.
|
|
31
|
+
"version": "1.1.2"
|
|
32
32
|
}
|