@ntlab/ntjs-assets 2.36.0 → 2.38.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/assets/js/bignumber.js/bignumber.min.js +1 -1
- package/assets/js/cdn.json +1 -1
- package/assets/js/jqGrid/css/ui.jqgrid-bootstrap.css +32 -0
- package/assets/js/jqGrid/css/ui.jqgrid-bootstrap4.css +32 -1
- package/assets/js/jqGrid/css/ui.jqgrid-bootstrap5.css +63 -0
- package/assets/js/jqGrid/css/ui.jqgrid.css +147 -4
- package/assets/js/jqGrid/js/addons/old_css_def.js +150 -0
- package/assets/js/jqGrid/js/grid.base.js +261 -581
- package/assets/js/jqGrid/js/grid.clipboard.js +588 -0
- package/assets/js/jqGrid/js/grid.common.js +91 -9
- package/assets/js/jqGrid/js/grid.export.js +95 -27
- package/assets/js/jqGrid/js/grid.filter.js +4 -50
- package/assets/js/jqGrid/js/grid.formedit.js +4 -1
- package/assets/js/jqGrid/js/grid.frozenrows.js +39 -160
- package/assets/js/jqGrid/js/grid.grouping.js +35 -48
- package/assets/js/jqGrid/js/grid.pivot.js +38 -16
- package/assets/js/jqGrid/js/grid.subgrid.js +1 -1
- package/assets/js/jqGrid/js/i18n/grid.locale-ar.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-bg.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-ca.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-cn.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-cs.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-de.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-dk.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-el.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-en.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-es.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-fa.js +31 -3
- package/assets/js/jqGrid/js/i18n/grid.locale-fi.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-fr.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-gl.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-he.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-hr.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-hu.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-id.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-is.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-it.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-ja.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-kr.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-lt.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-me.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-nl.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-no.js +28 -1
- package/assets/js/jqGrid/js/i18n/grid.locale-pl.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-pt-br.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-pt.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-ro.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-ru.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-sk.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-sq.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-sr-latin.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-sr.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-sv.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-th.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-tr.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-tw.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-uk.js +28 -0
- package/assets/js/jqGrid/js/i18n/grid.locale-vi.js +28 -0
- package/assets/js/jqGrid/js/jquery.jqGrid.js +1142 -896
- package/assets/js/jqGrid/js/jquery.jqGrid.min.js +2 -2
- package/assets/js/jqGrid/js/jquery.jqGrid.min.js.map +1 -1
- package/assets/js/jqGrid/js/minified/grid.aria.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.base.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.celledit.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.clipboard.js +1 -0
- package/assets/js/jqGrid/js/minified/grid.common.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.database.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.export.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.filter.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.formedit.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.frozenrows.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.grouping.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.import.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.inlinedit.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.jqueryui.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.pivot.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.subgrid.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.transposed.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.treegrid.js +1 -1
- package/assets/js/jqGrid/js/minified/grid.utils.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-ar.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-bg.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-ca.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-cn.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-cs.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-de.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-dk.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-el.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-en.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-es.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-fa.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-fi.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-fr.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-gl.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-he.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-hr.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-hu.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-id.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-is.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-it.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-ja.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-kr.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-lt.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-me.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-nl.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-no.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-pl.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-pt-br.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-pt.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-ro.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-ru.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-sk.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-sq.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-sr-latin.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-sr.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-sv.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-th.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-tr.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-tw.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-uk.js +1 -1
- package/assets/js/jqGrid/js/minified/i18n/grid.locale-vi.js +1 -1
- package/assets/js/jqGrid/js/minified/jqDnR.js +1 -1
- package/assets/js/jqGrid/js/minified/jqModal.js +1 -1
- package/assets/js/jqGrid/js/minified/jquery.fmatter.js +1 -1
- package/assets/js/jqGrid/js/minified/jquery.sortable.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* @license Guriddo jqGrid JS - v5.8.
|
|
3
|
+
* @license Guriddo jqGrid JS - v5.8.9 - 2025-04-01
|
|
4
4
|
* Copyright(c) 2008, Tony Tomov, tony@trirand.com
|
|
5
5
|
*
|
|
6
6
|
* License: http://guriddo.net/?page_id=103334
|
|
@@ -24,7 +24,7 @@ if(!$.jgrid.hasOwnProperty("defaults")) {
|
|
|
24
24
|
$.jgrid.defaults = {};
|
|
25
25
|
}
|
|
26
26
|
$.extend($.jgrid,{
|
|
27
|
-
version : "5.8.
|
|
27
|
+
version : "5.8.9",
|
|
28
28
|
isNull : function( p, strict_eq) {
|
|
29
29
|
if(strict_eq && strict_eq === true) {
|
|
30
30
|
return p === null;
|
|
@@ -95,7 +95,7 @@ $.extend($.jgrid,{
|
|
|
95
95
|
return $.jgrid.msiever() > 0;
|
|
96
96
|
},
|
|
97
97
|
msiever : function () {
|
|
98
|
-
var rv =0,
|
|
98
|
+
var rv = 0,
|
|
99
99
|
sAgent = window.navigator.userAgent,
|
|
100
100
|
Idx = sAgent.indexOf("MSIE");
|
|
101
101
|
|
|
@@ -477,6 +477,7 @@ $.extend($.jgrid,{
|
|
|
477
477
|
_negate=false,
|
|
478
478
|
_queuedOperator="",
|
|
479
479
|
_sorting=[],
|
|
480
|
+
_this = "a_d_d_t_h_i_s",
|
|
480
481
|
_useProperties=true;
|
|
481
482
|
if(typeof d==="object"&&d.push) {
|
|
482
483
|
if(d.length>0){
|
|
@@ -709,8 +710,9 @@ $.extend($.jgrid,{
|
|
|
709
710
|
if(match === null){
|
|
710
711
|
return self;
|
|
711
712
|
}
|
|
713
|
+
const re = new RegExp(`${_this}`, 'g');
|
|
712
714
|
$.each(_data,function(){
|
|
713
|
-
if($.jgrid.runCode.call($t, match.replace(
|
|
715
|
+
if($.jgrid.runCode.call($t, match.replace(re, JSON.stringify(this)) ) ){ //eval(match)
|
|
714
716
|
results.push(this);
|
|
715
717
|
}
|
|
716
718
|
});
|
|
@@ -776,16 +778,16 @@ $.extend($.jgrid,{
|
|
|
776
778
|
return self.is(f);
|
|
777
779
|
};
|
|
778
780
|
this.is=function(f){
|
|
779
|
-
self._append(
|
|
781
|
+
self._append(_this+"."+f);
|
|
780
782
|
self._resetNegate();
|
|
781
783
|
return self;
|
|
782
784
|
};
|
|
783
785
|
this._compareValues=function(func,f,v,how,t){
|
|
784
786
|
var fld;
|
|
785
787
|
if(_useProperties){
|
|
786
|
-
fld='jQuery.jgrid.getAccessor(
|
|
788
|
+
fld='jQuery.jgrid.getAccessor('+_this+',\''+f+'\')';
|
|
787
789
|
}else{
|
|
788
|
-
fld=
|
|
790
|
+
fld=_this;
|
|
789
791
|
}
|
|
790
792
|
if(v===undefined) { v = null; }
|
|
791
793
|
//var val=v===null?f:v,
|
|
@@ -846,12 +848,12 @@ $.extend($.jgrid,{
|
|
|
846
848
|
this.startsWith=function(f,v){
|
|
847
849
|
//var val = $.jgrid.isNull(v) ? f: v,
|
|
848
850
|
//length=_trim ? $.jgrid.trim(val.toString()).length : val.toString().length;
|
|
849
|
-
if(_useProperties){
|
|
851
|
+
if(_useProperties ){
|
|
850
852
|
//self._append(self._getStr('jQuery.jgrid.getAccessor(this,\''+f+'\')')+'.slice(0,'+length+') == '+self._getStr('"'+self._toStr(v)+'"'));
|
|
851
|
-
self._append(self._getStr('jQuery.jgrid.getAccessor(
|
|
853
|
+
self._append(self._getStr('jQuery.jgrid.getAccessor('+_this+',\''+f+'\')')+'.startsWith('+self._getStr('"'+self._toStr(v)+'"')+')');
|
|
852
854
|
}else{
|
|
853
855
|
//if ( !$.jgrid.isNull(v) ) { length=_trim?$.jgrid.trim(v.toString()).length:v.toString().length; }
|
|
854
|
-
self._append(self._getStr(
|
|
856
|
+
self._append(self._getStr(_this)+'.startsWith(' +self._getStr('"'+self._toStr(f)+'"')+')');
|
|
855
857
|
}
|
|
856
858
|
self._setCommand(self.startsWith,f);
|
|
857
859
|
self._resetNegate();
|
|
@@ -862,10 +864,10 @@ $.extend($.jgrid,{
|
|
|
862
864
|
//length=_trim ? $.jgrid.trim(val.toString()).length:val.toString().length;
|
|
863
865
|
if(_useProperties){
|
|
864
866
|
//self._append(self._getStr('jQuery.jgrid.getAccessor(this,\''+f+'\')')+'.substr('+self._getStr('jQuery.jgrid.getAccessor(this,\''+f+'\')')+'.length-'+length+','+length+') == "'+self._toStr(v)+'"');
|
|
865
|
-
self._append(self._getStr('jQuery.jgrid.getAccessor(
|
|
867
|
+
self._append(self._getStr('jQuery.jgrid.getAccessor('+_this+',\''+f+'\')')+'.endsWith('+self._getStr('"'+self._toStr(v)+'"')+')');
|
|
866
868
|
} else {
|
|
867
869
|
//self._append(self._getStr('this')+'.substr('+self._getStr('this')+'.length-"'+self._toStr(f)+'".length,"'+self._toStr(f)+'".length) == "'+self._toStr(f)+'"');
|
|
868
|
-
self._append(self._getStr(
|
|
870
|
+
self._append(self._getStr(_this)+'.endsWith(' +self._getStr('"'+self._toStr(f)+'"')+')');
|
|
869
871
|
}
|
|
870
872
|
self._setCommand(self.endsWith,f);
|
|
871
873
|
self._resetNegate();
|
|
@@ -873,9 +875,9 @@ $.extend($.jgrid,{
|
|
|
873
875
|
};
|
|
874
876
|
this.contains=function(f,v){
|
|
875
877
|
if(_useProperties){
|
|
876
|
-
self._append(self._getStr('jQuery.jgrid.getAccessor(
|
|
878
|
+
self._append(self._getStr('jQuery.jgrid.getAccessor('+_this+',\''+f+'\')')+'.indexOf("'+self._toStr(v)+'",0) > -1');
|
|
877
879
|
}else{
|
|
878
|
-
self._append(self._getStr(
|
|
880
|
+
self._append(self._getStr(_this)+'.indexOf("'+self._toStr(f)+'",0) > -1');
|
|
879
881
|
}
|
|
880
882
|
self._setCommand(self.contains,f);
|
|
881
883
|
self._resetNegate();
|
|
@@ -883,7 +885,7 @@ $.extend($.jgrid,{
|
|
|
883
885
|
};
|
|
884
886
|
this.user=function(op, f, v){
|
|
885
887
|
var _a = '$("#'+$t.p.id+'")[0]';
|
|
886
|
-
self._append(_a + '.p.customFilterDef.' + op + '.action.call('+_a+' ,{rowItem:
|
|
888
|
+
self._append(_a + '.p.customFilterDef.' + op + '.action.call('+_a+' ,{rowItem:'+_this+', searchName:"' + f + '",searchValue:"' + v + '"})');
|
|
887
889
|
self._setCommand(self.user,f);
|
|
888
890
|
self._resetNegate();
|
|
889
891
|
return self;
|
|
@@ -891,9 +893,9 @@ $.extend($.jgrid,{
|
|
|
891
893
|
this.inData = function (f, v, t) {
|
|
892
894
|
var vl = v === undefined ? "" : self._getStr("\"" + self._toStr(v) + "\"");
|
|
893
895
|
if( _useProperties ) {
|
|
894
|
-
self._append(vl + '.split(\''+',' + '\')' + '.indexOf( jQuery.jgrid.getAccessor(
|
|
896
|
+
self._append(vl + '.split(\''+',' + '\')' + '.indexOf( jQuery.jgrid.getAccessor('+_this+',\''+f+'\') ) > -1');
|
|
895
897
|
} else {
|
|
896
|
-
self._append(vl + '.split(\''+',' + '\')' + '.indexOf(
|
|
898
|
+
self._append(vl + '.split(\''+',' + '\')' + '.indexOf('+_this+'.'+f+') > -1');
|
|
897
899
|
}
|
|
898
900
|
self._setCommand(self.inData, f);
|
|
899
901
|
self._resetNegate();
|
|
@@ -1095,10 +1097,9 @@ $.extend($.jgrid,{
|
|
|
1095
1097
|
val = "";
|
|
1096
1098
|
}
|
|
1097
1099
|
if(tb.p.frozenColumns) {
|
|
1098
|
-
$(tb
|
|
1100
|
+
$(tb).jqGrid('destroyFrozenColumns');
|
|
1099
1101
|
frozen = true;
|
|
1100
1102
|
}
|
|
1101
|
-
|
|
1102
1103
|
if(!tb.p._ftsc) {
|
|
1103
1104
|
// store originally hidden columns
|
|
1104
1105
|
tb.p._ftsc = true;
|
|
@@ -1199,21 +1200,9 @@ $.extend($.jgrid,{
|
|
|
1199
1200
|
var swap = to_show.concat(_cnth);
|
|
1200
1201
|
|
|
1201
1202
|
$(tb).jqGrid('showCol',swap);
|
|
1202
|
-
if(
|
|
1203
|
-
|
|
1204
|
-
$(tb.grid.fbDiv).find(".jqgrid-searchcol >input#jqs_"+tb.p.id+"_"+rid).val("").focus().val(val);
|
|
1205
|
-
//}, 60);
|
|
1206
|
-
}
|
|
1207
|
-
if(tb.p.frozenRows) {
|
|
1208
|
-
if(frozen) { // for future processing
|
|
1209
|
-
tb.p.frozenColumns = false;
|
|
1210
|
-
}
|
|
1211
|
-
$(tb).trigger('jqGridAfterGridComplete.setFrozenRows');
|
|
1212
|
-
if(frozen) { // for future processing
|
|
1213
|
-
tb.p.frozenColumns = true;
|
|
1214
|
-
}
|
|
1203
|
+
if(frozen) { // for future processing
|
|
1204
|
+
$(tb).jqGrid('setFrozenColumns');
|
|
1215
1205
|
}
|
|
1216
|
-
|
|
1217
1206
|
/// let intersection = arrA.filter(x => arrB.includes(x));
|
|
1218
1207
|
/// let difference = arrA.filter(x => !arrB.includes(x));
|
|
1219
1208
|
/// let difference = arrA
|
|
@@ -1521,148 +1510,15 @@ $.extend($.jgrid,{
|
|
|
1521
1510
|
icon_oper_op : "ui-icon-transfer-e-w",
|
|
1522
1511
|
icon_reset : "ui-icon-arrowreturnthick-1-w",
|
|
1523
1512
|
icon_close : "ui-icon-close"
|
|
1524
|
-
}
|
|
1525
1513
|
},
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
hidden : "",
|
|
1535
|
-
icon_base : "glyphicon",
|
|
1536
|
-
overlay: "ui-overlay",
|
|
1537
|
-
active : "active",
|
|
1538
|
-
error : "bg-danger",
|
|
1539
|
-
button : "btn btn-default",
|
|
1540
|
-
content : "",
|
|
1541
|
-
shadow : ""
|
|
1542
|
-
},
|
|
1543
|
-
base : {
|
|
1544
|
-
entrieBox : "",
|
|
1545
|
-
viewBox : "table-responsive",
|
|
1546
|
-
headerTable : "table table-bordered",
|
|
1547
|
-
headerBox : "",
|
|
1548
|
-
rowTable : "table table-bordered",
|
|
1549
|
-
rowBox : "",
|
|
1550
|
-
stripedTable : "table-striped",
|
|
1551
|
-
footerTable : "table table-bordered",
|
|
1552
|
-
footerBox : "",
|
|
1553
|
-
headerRowTable : "table table-bordered",
|
|
1554
|
-
headerRowBox : "",
|
|
1555
|
-
headerDiv : "",
|
|
1556
|
-
gridtitleBox : "",
|
|
1557
|
-
customtoolbarBox : "",
|
|
1558
|
-
//overlayBox: "ui-overlay",
|
|
1559
|
-
loadingBox : "row",
|
|
1560
|
-
rownumBox : "active",
|
|
1561
|
-
scrollBox : "",
|
|
1562
|
-
multiBox : "checkbox",
|
|
1563
|
-
pagerBox : "",
|
|
1564
|
-
pagerTable : "table",
|
|
1565
|
-
toppagerBox : "",
|
|
1566
|
-
pgInput : "form-control",
|
|
1567
|
-
pgSelectBox : "form-control",
|
|
1568
|
-
pgButtonBox : "",
|
|
1569
|
-
icon_first : "glyphicon-step-backward",
|
|
1570
|
-
icon_prev : "glyphicon-backward",
|
|
1571
|
-
icon_next: "glyphicon-forward",
|
|
1572
|
-
icon_end: "glyphicon-step-forward",
|
|
1573
|
-
icon_asc : "glyphicon-triangle-top",
|
|
1574
|
-
icon_desc : "glyphicon-triangle-bottom",
|
|
1575
|
-
icon_caption_open : "glyphicon-circle-arrow-up",
|
|
1576
|
-
icon_caption_close : "glyphicon-circle-arrow-down"
|
|
1577
|
-
},
|
|
1578
|
-
modal : {
|
|
1579
|
-
modal : "modal",
|
|
1580
|
-
content :"modal-content",
|
|
1581
|
-
header : "modal-header",
|
|
1582
|
-
title : "modal-title",
|
|
1583
|
-
body :"modal-body",
|
|
1584
|
-
footer :"modal-footer",
|
|
1585
|
-
resizable : "ui-resizable-handle ui-resizable-se",
|
|
1586
|
-
icon_close : "glyphicon-remove-circle",
|
|
1587
|
-
icon_resizable : "glyphicon-import"
|
|
1588
|
-
},
|
|
1589
|
-
celledit : {
|
|
1590
|
-
inputClass : 'form-control',
|
|
1591
|
-
selectClass: 'form-control'
|
|
1592
|
-
},
|
|
1593
|
-
inlinedit : {
|
|
1594
|
-
inputClass : 'form-control',
|
|
1595
|
-
selectClass: 'form-control',
|
|
1596
|
-
icon_edit_nav : "glyphicon-edit",
|
|
1597
|
-
icon_add_nav : "glyphicon-plus",
|
|
1598
|
-
icon_save_nav : "glyphicon-save",
|
|
1599
|
-
icon_cancel_nav : "glyphicon-remove-circle"
|
|
1600
|
-
},
|
|
1601
|
-
formedit : {
|
|
1602
|
-
labelClass : "",
|
|
1603
|
-
inputClass : "form-control",
|
|
1604
|
-
selectClass: 'form-control',
|
|
1605
|
-
icon_prev : "glyphicon-step-backward",
|
|
1606
|
-
icon_next : "glyphicon-step-forward",
|
|
1607
|
-
icon_save : "glyphicon-save",
|
|
1608
|
-
icon_close : "glyphicon-remove-circle",
|
|
1609
|
-
icon_del : "glyphicon-trash",
|
|
1610
|
-
icon_cancel : "glyphicon-remove-circle"
|
|
1611
|
-
},
|
|
1612
|
-
navigator : {
|
|
1613
|
-
icon_edit_nav : "glyphicon-edit",
|
|
1614
|
-
icon_add_nav : "glyphicon-plus",
|
|
1615
|
-
icon_del_nav : "glyphicon-trash",
|
|
1616
|
-
icon_search_nav : "glyphicon-search",
|
|
1617
|
-
icon_refresh_nav : "glyphicon-refresh",
|
|
1618
|
-
icon_view_nav : "glyphicon-info-sign",
|
|
1619
|
-
icon_newbutton_nav : "glyphicon-new-window"
|
|
1620
|
-
},
|
|
1621
|
-
grouping : {
|
|
1622
|
-
icon_plus : 'glyphicon-triangle-right',
|
|
1623
|
-
icon_minus : 'glyphicon-triangle-bottom'
|
|
1624
|
-
},
|
|
1625
|
-
filter : {
|
|
1626
|
-
table_widget : 'table table-condensed',
|
|
1627
|
-
srSelect : 'form-control',
|
|
1628
|
-
srInput : 'form-control',
|
|
1629
|
-
menu_widget : '',
|
|
1630
|
-
icon_search : 'glyphicon-search',
|
|
1631
|
-
icon_reset : 'glyphicon-refresh',
|
|
1632
|
-
icon_query :'glyphicon-comment'
|
|
1633
|
-
},
|
|
1634
|
-
subgrid : {
|
|
1635
|
-
icon_plus : 'glyphicon-triangle-right',
|
|
1636
|
-
icon_minus : 'glyphicon-triangle-bottom',
|
|
1637
|
-
icon_open : 'glyphicon-indent-left'
|
|
1638
|
-
},
|
|
1639
|
-
treegrid : {
|
|
1640
|
-
icon_plus : 'glyphicon-triangle-right',
|
|
1641
|
-
icon_minus : 'glyphicon-triangle-bottom',
|
|
1642
|
-
icon_leaf : 'glyphicon-unchecked'
|
|
1643
|
-
},
|
|
1644
|
-
fmatter : {
|
|
1645
|
-
icon_edit : "glyphicon-edit",
|
|
1646
|
-
icon_add : "glyphicon-plus",
|
|
1647
|
-
icon_save : "glyphicon-save",
|
|
1648
|
-
icon_cancel : "glyphicon-remove-circle",
|
|
1649
|
-
icon_del : "glyphicon-trash"
|
|
1650
|
-
},
|
|
1651
|
-
colmenu : {
|
|
1652
|
-
menu_widget : '',
|
|
1653
|
-
input_checkbox : "",
|
|
1654
|
-
filter_select: "form-control",
|
|
1655
|
-
filter_input : "form-control",
|
|
1656
|
-
icon_menu : "glyphicon-menu-hamburger",
|
|
1657
|
-
icon_sort_asc : "glyphicon-sort-by-alphabet",
|
|
1658
|
-
icon_sort_desc : "glyphicon-sort-by-alphabet-alt",
|
|
1659
|
-
icon_columns : "glyphicon-list-alt",
|
|
1660
|
-
icon_filter : "glyphicon-filter",
|
|
1661
|
-
icon_group : "glyphicon-align-left",
|
|
1662
|
-
icon_freeze : "glyphicon-object-align-horizontal",
|
|
1663
|
-
icon_move: "glyphicon-move",
|
|
1664
|
-
icon_new_item : "glyphicon-new-window",
|
|
1665
|
-
icon_toolbar_menu : "glyphicon-menu-hamburger"
|
|
1514
|
+
clipboard : {
|
|
1515
|
+
icon_copy :"ui-icon-copy",
|
|
1516
|
+
icon_paste : "ui-icon-clipboard",
|
|
1517
|
+
icon_paste_add: "ui-icon-plusthick",
|
|
1518
|
+
icon_repeat_row :"ui-icon-arrow-1-s",
|
|
1519
|
+
icon_repeat_col :"ui-icon-arrow-1-e",
|
|
1520
|
+
icon_undo: "ui-icon-arrowreturn-1-w",
|
|
1521
|
+
icon_cancel : "ui-icon-cancel"
|
|
1666
1522
|
}
|
|
1667
1523
|
},
|
|
1668
1524
|
Bootstrap4 : {
|
|
@@ -1933,6 +1789,15 @@ $.extend($.jgrid,{
|
|
|
1933
1789
|
icon_oper_op : "",
|
|
1934
1790
|
icon_reset : "oi-reload",
|
|
1935
1791
|
icon_close : "oi-ban"
|
|
1792
|
+
},
|
|
1793
|
+
clipboard : {
|
|
1794
|
+
icon_copy :"oi-copy-outline",
|
|
1795
|
+
icon_paste : "oi-clipboard-outline",
|
|
1796
|
+
icon_paste_add: "oi-download-outline",
|
|
1797
|
+
icon_repeat_row :"oi-arrow-down-outline",
|
|
1798
|
+
icon_repeat_col :"oi-arrow-forward-outline",
|
|
1799
|
+
icon_undo: "oi-arrow-undo-outline",
|
|
1800
|
+
icon_cancel : "oi-exit-outline"
|
|
1936
1801
|
}
|
|
1937
1802
|
},
|
|
1938
1803
|
Octicons : {
|
|
@@ -2017,6 +1882,15 @@ $.extend($.jgrid,{
|
|
|
2017
1882
|
icon_oper_op : "",
|
|
2018
1883
|
icon_reset : "octicon-sync",
|
|
2019
1884
|
icon_close : "octicon-x"
|
|
1885
|
+
},
|
|
1886
|
+
clipboard : {
|
|
1887
|
+
icon_copy :"octicon-copy",
|
|
1888
|
+
icon_paste : "octicon-paste",
|
|
1889
|
+
icon_paste_add: "octicon-north-star",
|
|
1890
|
+
icon_repeat_row :"octicon-move-to-bottom",
|
|
1891
|
+
icon_repeat_col :"octicon-move-to-end",
|
|
1892
|
+
icon_undo: "octicon-undo",
|
|
1893
|
+
icon_cancel : "octicon-x"
|
|
2020
1894
|
}
|
|
2021
1895
|
},
|
|
2022
1896
|
fontAwesome : {
|
|
@@ -2102,6 +1976,15 @@ $.extend($.jgrid,{
|
|
|
2102
1976
|
icon_reset : "fa-reply",
|
|
2103
1977
|
icon_close : "fa-window-close"
|
|
2104
1978
|
|
|
1979
|
+
},
|
|
1980
|
+
clipboard : {
|
|
1981
|
+
icon_copy :"fa-copy",
|
|
1982
|
+
icon_paste : "fa-paste",
|
|
1983
|
+
icon_paste_add: "fa-plus",
|
|
1984
|
+
icon_repeat_row :"fa-arrow-down",
|
|
1985
|
+
icon_repeat_col :"fa-arrow-right",
|
|
1986
|
+
icon_undo: "fa-rotate-left",
|
|
1987
|
+
icon_cancel : "fa-xmark"
|
|
2105
1988
|
}
|
|
2106
1989
|
},
|
|
2107
1990
|
Bootstrap5 : {
|
|
@@ -2186,6 +2069,15 @@ $.extend($.jgrid,{
|
|
|
2186
2069
|
icon_oper_op : "",
|
|
2187
2070
|
icon_reset : "bi-arrow-clockwise",
|
|
2188
2071
|
icon_close : "bi-x-square"
|
|
2072
|
+
},
|
|
2073
|
+
clipboard : {
|
|
2074
|
+
icon_copy :"bi-clipboard-fill",
|
|
2075
|
+
icon_paste : "bi-clipboard",
|
|
2076
|
+
icon_paste_add: "bi-clipboard-plus",
|
|
2077
|
+
icon_repeat_row :"bi-arrow-bar-down",
|
|
2078
|
+
icon_repeat_col :"bi-arrow-bar-right",
|
|
2079
|
+
icon_undo: "bi-arrow-counterclockwise",
|
|
2080
|
+
icon_cancel : "bi-x"
|
|
2189
2081
|
}
|
|
2190
2082
|
}
|
|
2191
2083
|
}
|
|
@@ -2299,7 +2191,6 @@ $.fn.jqGrid = function( pin ) {
|
|
|
2299
2191
|
nv:0,
|
|
2300
2192
|
loadui: "enable",
|
|
2301
2193
|
toolbar: [false,""],
|
|
2302
|
-
scroll: false,
|
|
2303
2194
|
deselectAfterSort : true,
|
|
2304
2195
|
scrollrows : false,
|
|
2305
2196
|
autowidth: false,
|
|
@@ -2324,7 +2215,6 @@ $.fn.jqGrid = function( pin ) {
|
|
|
2324
2215
|
direction : "ltr",
|
|
2325
2216
|
toppager: false,
|
|
2326
2217
|
headertitles: false,
|
|
2327
|
-
scrollTimeout: 40,
|
|
2328
2218
|
data : [],
|
|
2329
2219
|
_index : {},
|
|
2330
2220
|
grouping : false,
|
|
@@ -2354,10 +2244,12 @@ $.fn.jqGrid = function( pin ) {
|
|
|
2354
2244
|
minColWidth : 33,
|
|
2355
2245
|
minGridWidth : 100,
|
|
2356
2246
|
maxGridWidth : 3000,
|
|
2247
|
+
scroll: false,
|
|
2248
|
+
scrollTimeout: 300,
|
|
2357
2249
|
scrollPopUp : false,
|
|
2358
2250
|
scrollTopOffset: 0, // pixel
|
|
2359
2251
|
scrollLeftOffset : "100%", //percent
|
|
2360
|
-
scrollMaxBuffer :
|
|
2252
|
+
scrollMaxBuffer : 1,
|
|
2361
2253
|
storeNavOptions: false,
|
|
2362
2254
|
regional : "en",
|
|
2363
2255
|
styleUI : "jQueryUI",
|
|
@@ -2415,7 +2307,8 @@ $.fn.jqGrid = function( pin ) {
|
|
|
2415
2307
|
reader : null,
|
|
2416
2308
|
beforeInsertData : null,
|
|
2417
2309
|
fetchOptions : {}
|
|
2418
|
-
}
|
|
2310
|
+
},
|
|
2311
|
+
isClipboard : false,
|
|
2419
2312
|
}, $.jgrid.defaults , pin );
|
|
2420
2313
|
if (localData !== undefined) {
|
|
2421
2314
|
p.data = localData;
|
|
@@ -2505,14 +2398,15 @@ $.fn.jqGrid = function( pin ) {
|
|
|
2505
2398
|
if($.jgrid.isFunction(p.resizeStop)) { p.resizeStop.call(ts,nw,idx); }
|
|
2506
2399
|
}
|
|
2507
2400
|
if(p.frozenColumns && forceFrozen) {
|
|
2508
|
-
|
|
2509
|
-
|
|
2401
|
+
if(idx <= p.frozenColCount) {
|
|
2402
|
+
$("#"+$.jgrid.jqID(p.id)).jqGrid('refreshFrozenColumns');
|
|
2403
|
+
}
|
|
2510
2404
|
}
|
|
2511
2405
|
}
|
|
2512
2406
|
this.curGbox = null;
|
|
2513
2407
|
document.onselectstart=function(){return true;};
|
|
2514
2408
|
},
|
|
2515
|
-
populateVisible: function() {
|
|
2409
|
+
populateVisible : function() {
|
|
2516
2410
|
if (grid.timer) { clearTimeout(grid.timer); }
|
|
2517
2411
|
grid.timer = null;
|
|
2518
2412
|
var dh = $(grid.bDiv).height();
|
|
@@ -2539,7 +2433,7 @@ $.fn.jqGrid = function( pin ) {
|
|
|
2539
2433
|
(p.lastpage===undefined||(parseInt((tbot + scrollTop + div - 1) / div,10) || 0) <= p.lastpage))
|
|
2540
2434
|
{
|
|
2541
2435
|
npage = parseInt((dh - tbot + div - 1) / div,10) || 1;
|
|
2542
|
-
if (tbot >= 0 || npage < 2
|
|
2436
|
+
if (tbot >= 0 || npage < 2) {
|
|
2543
2437
|
page = ( Math.round((tbot + scrollTop) / div) || 0) + 1;
|
|
2544
2438
|
ttop = -1;
|
|
2545
2439
|
} else {
|
|
@@ -2569,15 +2463,12 @@ $.fn.jqGrid = function( pin ) {
|
|
|
2569
2463
|
}
|
|
2570
2464
|
if (empty) {
|
|
2571
2465
|
grid.selectionPreserver(table[0]);
|
|
2572
|
-
grid.emptyRows.call(table[0],
|
|
2466
|
+
grid.emptyRows.call(table[0], true, false);
|
|
2573
2467
|
}
|
|
2574
2468
|
grid.populate(npage);
|
|
2575
2469
|
}
|
|
2576
2470
|
if(p.scrollPopUp && !$.jgrid.isNull(p.lastpage)) {
|
|
2577
|
-
$("#scroll_g"+p.id).
|
|
2578
|
-
$(this).mouseout(function(){
|
|
2579
|
-
$("#scroll_g"+p.id).hide();
|
|
2580
|
-
});
|
|
2471
|
+
$("#scroll_g"+p.id).html( $.jgrid.template( $.jgrid.getRegional(ts, "defaults.pgtext", p.pgtext) , p.page, p.lastpage)).css({ "top": p.scrollTopOffset+scrollTop*((parseInt(p.height,10) - 45)/ (parseInt(rh,10)*parseInt(p.records,10))) +"px", "left" : p.scrollLeftOffset});
|
|
2581
2472
|
}
|
|
2582
2473
|
}
|
|
2583
2474
|
},
|
|
@@ -2593,6 +2484,9 @@ $.fn.jqGrid = function( pin ) {
|
|
|
2593
2484
|
if (grid.timer) { clearTimeout(grid.timer); }
|
|
2594
2485
|
grid.timer = setTimeout(grid.populateVisible, p.scrollTimeout);
|
|
2595
2486
|
}
|
|
2487
|
+
if(p.scrollPopUp && !$.jgrid.isNull(p.lastpage)) {
|
|
2488
|
+
$("#scroll_g"+p.id).show();
|
|
2489
|
+
}
|
|
2596
2490
|
}
|
|
2597
2491
|
grid.hDiv.scrollLeft = grid.bDiv.scrollLeft;
|
|
2598
2492
|
if(p.footerrow) {
|
|
@@ -2601,9 +2495,6 @@ $.fn.jqGrid = function( pin ) {
|
|
|
2601
2495
|
if(p.headerrow) {
|
|
2602
2496
|
grid.hrDiv.scrollLeft = grid.bDiv.scrollLeft;
|
|
2603
2497
|
}
|
|
2604
|
-
if(p.frozenColumns) {
|
|
2605
|
-
$(grid.fbDiv).scrollTop( grid.bDiv.scrollTop );
|
|
2606
|
-
}
|
|
2607
2498
|
try {
|
|
2608
2499
|
$("#column_menu").remove();
|
|
2609
2500
|
} catch (e) {}
|
|
@@ -2814,9 +2705,9 @@ $.fn.jqGrid = function( pin ) {
|
|
|
2814
2705
|
},
|
|
2815
2706
|
reader = function (datatype) {
|
|
2816
2707
|
var field, f=[], j=0, i;
|
|
2817
|
-
for(i =0; i<ts.p.colModel.length; i++){
|
|
2708
|
+
for(i = 0; i < ts.p.colModel.length; i++){
|
|
2818
2709
|
field = ts.p.colModel[i];
|
|
2819
|
-
if (field
|
|
2710
|
+
if ( Object.hasOwn(field, "name") && !$.jgrid.isServiceCol(field.name) ) {
|
|
2820
2711
|
f[j]= datatype === "local" ?
|
|
2821
2712
|
field.name :
|
|
2822
2713
|
( (datatype==="xml" || datatype === "xmlstring") ? field.xmlmap || field.name : field.jsonmap || field.name );
|
|
@@ -4191,7 +4082,9 @@ $.fn.jqGrid = function( pin ) {
|
|
|
4191
4082
|
if(lc) { lc.call(ts,req); }
|
|
4192
4083
|
$(ts).triggerHandler("jqGridAfterLoadComplete", [req]);
|
|
4193
4084
|
if (pvis) { ts.grid.populateVisible(); }
|
|
4085
|
+
if (npage === 1) {
|
|
4194
4086
|
endReq();
|
|
4087
|
+
}
|
|
4195
4088
|
ts.p._ald = false;
|
|
4196
4089
|
break;
|
|
4197
4090
|
case "indexeddb":
|
|
@@ -4219,10 +4112,6 @@ $.fn.jqGrid = function( pin ) {
|
|
|
4219
4112
|
},
|
|
4220
4113
|
setHeadCheckBox = function ( checked ) {
|
|
4221
4114
|
$('#cb_'+$.jgrid.jqID(ts.p.id),ts.grid.hDiv)[ts.p.useProp ? 'prop': 'attr']("checked", checked);
|
|
4222
|
-
var fid = ts.p.frozenColumns ? ts.p.id+"_frozen" : "";
|
|
4223
|
-
if(fid) {
|
|
4224
|
-
$('#cb_'+$.jgrid.jqID(ts.p.id),ts.grid.fhDiv)[ts.p.useProp ? 'prop': 'attr']("checked", checked);
|
|
4225
|
-
}
|
|
4226
4115
|
},
|
|
4227
4116
|
setPager = function (pgid, tp){
|
|
4228
4117
|
// TBD - consider escaping pgid with pgid = $.jgrid.jqID(pgid);
|
|
@@ -4409,10 +4298,6 @@ $.fn.jqGrid = function( pin ) {
|
|
|
4409
4298
|
var cm = ts.p.colModel,selarr =[],
|
|
4410
4299
|
/*ts.p.frozenColumns ? (ts.p.autoResizing ? ts.grid.headers[iCol].el : obj) :*/ so="", sn;
|
|
4411
4300
|
selarr.push(ts.grid.headers[iCol].el);
|
|
4412
|
-
if(ts.p.frozenColumns) {
|
|
4413
|
-
selarr.push(obj);
|
|
4414
|
-
}
|
|
4415
|
-
|
|
4416
4301
|
$("span.ui-grid-ico-sort",selarr).addClass(disabled);
|
|
4417
4302
|
$(selarr).attr({"aria-selected":"false","aria-sort" : "none"});
|
|
4418
4303
|
sn = (cm[iCol].index || cm[iCol].name);
|
|
@@ -4505,7 +4390,7 @@ $.fn.jqGrid = function( pin ) {
|
|
|
4505
4390
|
ts.p.sortorder = sor;
|
|
4506
4391
|
}
|
|
4507
4392
|
var previousSelectedTh = ts.grid.headers[ts.p.lastsort] ? ts.grid.headers[ts.p.lastsort].el : null, newSelectedTh = /*ts.p.frozenColumns ? obj :*/ ts.grid.headers[idxcol].el,
|
|
4508
|
-
newSelThFC = ts.p.frozenColumns ? obj : null,
|
|
4393
|
+
// newSelThFC = ts.p.frozenColumns ? obj : null,
|
|
4509
4394
|
//sortrule = $.trim(ts.p.viewsortcols[1] === 'single' ? hidden : disabled);
|
|
4510
4395
|
usehide = ts.p.viewsortcols[1] === 'single' ? true : false, tmpicon;
|
|
4511
4396
|
tmpicon = $(previousSelectedTh).find("span.ui-grid-ico-sort");
|
|
@@ -4514,33 +4399,14 @@ $.fn.jqGrid = function( pin ) {
|
|
|
4514
4399
|
$(tmpicon).css("display","none");
|
|
4515
4400
|
}
|
|
4516
4401
|
$(previousSelectedTh).attr({"aria-selected":"false","aria-sort" : "none"});
|
|
4517
|
-
if(ts.p.frozenColumns) {
|
|
4518
|
-
tmpicon = ts.grid.fhDiv.find("span.ui-grid-ico-sort");
|
|
4519
|
-
tmpicon.addClass(disabled);
|
|
4520
|
-
if(usehide) { tmpicon.css("display","none"); }
|
|
4521
|
-
ts.grid.fhDiv.find("th").attr({"aria-selected":"false","aria-sort" : "none"});
|
|
4522
|
-
}
|
|
4523
4402
|
tmpicon = $(newSelectedTh).find("span.ui-icon-"+ts.p.sortorder);
|
|
4524
4403
|
tmpicon.removeClass(disabled);
|
|
4525
4404
|
if(usehide) { tmpicon.css("display",""); }
|
|
4526
4405
|
$(newSelectedTh).attr({"aria-selected":"true","aria-sort" : ts.p.sortorder + "ending"});
|
|
4527
|
-
if(ts.p.frozenColumns) {
|
|
4528
|
-
tmpicon = $(newSelThFC).find("span.ui-icon-"+ts.p.sortorder);
|
|
4529
|
-
tmpicon.removeClass(disabled);
|
|
4530
|
-
if(usehide) { tmpicon.css("display",""); }
|
|
4531
|
-
$(newSelThFC).attr({"aria-selected":"true","aria-sort" : ts.p.sortorder + "ending"});
|
|
4532
|
-
|
|
4533
|
-
}
|
|
4534
4406
|
if(!ts.p.viewsortcols[0]) {
|
|
4535
4407
|
if(ts.p.lastsort !== idxcol) {
|
|
4536
|
-
if(ts.p.frozenColumns){
|
|
4537
|
-
ts.grid.fhDiv.find("span.s-ico").hide();
|
|
4538
|
-
}
|
|
4539
4408
|
$("span.s-ico",previousSelectedTh).hide();
|
|
4540
4409
|
$("span.s-ico",newSelectedTh).show();
|
|
4541
|
-
if(newSelThFC) {
|
|
4542
|
-
$("span.s-ico",newSelThFC).show();
|
|
4543
|
-
}
|
|
4544
4410
|
} else if (ts.p.sortname === "") { // if ts.p.lastsort === idxcol but ts.p.sortname === ""
|
|
4545
4411
|
$("span.s-ico",newSelectedTh).show();
|
|
4546
4412
|
}
|
|
@@ -5052,10 +4918,6 @@ $.fn.jqGrid = function( pin ) {
|
|
|
5052
4918
|
ts.p.colMenuBeforeProcess.call(ts, { module: 'grouping', action : (isgroup !== -1? 'ungroup' : 'group'), column : cm.name});
|
|
5053
4919
|
}
|
|
5054
4920
|
$(ts).jqGrid('groupingGroupBy', group.groupField );
|
|
5055
|
-
if(ts.p.frozenColumns) {
|
|
5056
|
-
$(ts).jqGrid("destroyFrozenColumns");
|
|
5057
|
-
$(ts).jqGrid("setFrozenColumns");
|
|
5058
|
-
}
|
|
5059
4921
|
},
|
|
5060
4922
|
buildFreeze = function( index, isfreeze ) {
|
|
5061
4923
|
var cols = [], i, len = ts.p.colModel.length, lastfrozen = -1, cm = ts.p.colModel;
|
|
@@ -5304,7 +5166,7 @@ $.fn.jqGrid = function( pin ) {
|
|
|
5304
5166
|
ts.p.sortorder = ts.p.sortorder.toLowerCase();
|
|
5305
5167
|
$.jgrid.cell_width = $.jgrid.cellWidth();
|
|
5306
5168
|
// calculate cellLayout
|
|
5307
|
-
var bstw2 = $("<table style='visibility:hidden'><tr class='jqgrow'><td>1</td></tr></table
|
|
5169
|
+
var bstw2 = $("<table style='visibility:hidden'><tr class='jqgrow'><td>1</td></tr></table>").addClass(getstyle(stylemodule,"rowTable", true, 'ui-jqgrid-btable ui-common-table'));
|
|
5308
5170
|
$(eg).append(bstw2);
|
|
5309
5171
|
ts.p.cellLayout = $.jgrid.floatNum( $("td", bstw2).css('padding-left')) + $.jgrid.floatNum($("td", bstw2).css('padding-right'), 10) + 1;
|
|
5310
5172
|
if(ts.p.cellLayout <=0 ) {
|
|
@@ -5468,7 +5330,6 @@ $.fn.jqGrid = function( pin ) {
|
|
|
5468
5330
|
if(!ts.p.preserveSelection) {
|
|
5469
5331
|
ts.p.selarrrow = [];
|
|
5470
5332
|
}
|
|
5471
|
-
var froz = ts.p.frozenColumns === true ? ts.p.id + "_frozen" : "";
|
|
5472
5333
|
if (this.checked) {
|
|
5473
5334
|
$(ts.rows).each(function(i) {
|
|
5474
5335
|
if (i>0) {
|
|
@@ -5483,10 +5344,6 @@ $.fn.jqGrid = function( pin ) {
|
|
|
5483
5344
|
ts.p.selarrrow.push(this.id);
|
|
5484
5345
|
}
|
|
5485
5346
|
ts.p.selrow = this.id;
|
|
5486
|
-
if(froz) {
|
|
5487
|
-
$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(this.id), ts.grid.fbDiv )[ts.p.useProp ? 'prop': 'attr']("checked",true);
|
|
5488
|
-
$("#"+$.jgrid.jqID(this.id), ts.grid.fbDiv).addClass(highlight);
|
|
5489
|
-
}
|
|
5490
5347
|
}
|
|
5491
5348
|
}
|
|
5492
5349
|
});
|
|
@@ -5506,10 +5363,6 @@ $.fn.jqGrid = function( pin ) {
|
|
|
5506
5363
|
ts.p.selarrrow.splice(curind, 1);
|
|
5507
5364
|
}
|
|
5508
5365
|
}
|
|
5509
|
-
if(froz) {
|
|
5510
|
-
$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(this.id), ts.grid.fbDiv )[ts.p.useProp ? 'prop': 'attr']("checked",false);
|
|
5511
|
-
$("#"+$.jgrid.jqID(this.id), ts.grid.fbDiv).removeClass(highlight);
|
|
5512
|
-
}
|
|
5513
5366
|
}
|
|
5514
5367
|
}
|
|
5515
5368
|
});
|
|
@@ -5528,7 +5381,10 @@ $.fn.jqGrid = function( pin ) {
|
|
|
5528
5381
|
bstw2 = ts.p.styleUI.search('Bootstrap') !== -1;
|
|
5529
5382
|
$(eg).css("width",grid.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+ts.p.id+"'> </div>");
|
|
5530
5383
|
if(ts.p.scrollPopUp) {
|
|
5531
|
-
$(eg).append("<div "+ getstyle(stylemodule, 'scrollBox', false, 'loading ui-scroll-popup')+" id='scroll_g"+ts.p.id+"'></div>")
|
|
5384
|
+
$(eg).append("<div "+ getstyle(stylemodule, 'scrollBox', false, 'loading ui-scroll-popup')+" id='scroll_g"+ts.p.id+"'></div>")
|
|
5385
|
+
.mouseout(function(){
|
|
5386
|
+
$("#scroll_g"+p.id).hide();
|
|
5387
|
+
});
|
|
5532
5388
|
}
|
|
5533
5389
|
$(gv).css("width",grid.width+"px");
|
|
5534
5390
|
thead = $(ts).find("thead").first().get(0);
|
|
@@ -5649,18 +5505,11 @@ $.fn.jqGrid = function( pin ) {
|
|
|
5649
5505
|
ts.p.disableClick = false;
|
|
5650
5506
|
return false;
|
|
5651
5507
|
}
|
|
5652
|
-
var s = "th>div.ui-th-div",r,d;
|
|
5508
|
+
var s = "th>div.ui-th-div",r,d,sh;
|
|
5653
5509
|
if (!ts.p.viewsortcols[2]) { s = "th>div>span>span.ui-grid-ico-sort"; }
|
|
5654
5510
|
var t = $(e.target).closest(s);
|
|
5655
5511
|
if (t.length !== 1) { return; }
|
|
5656
|
-
var ci;
|
|
5657
|
-
if(ts.p.frozenColumns) {
|
|
5658
|
-
var tid = $(this)[0].id.substring( ts.p.id.length + 1 );
|
|
5659
|
-
ci = $.jgrid.getElemByAttrVal(ts.p.colModel, 'name', tid, true);
|
|
5660
|
-
} else {
|
|
5661
|
-
ci = getColumnHeaderIndex(this);
|
|
5662
|
-
}
|
|
5663
|
-
//
|
|
5512
|
+
var ci = getColumnHeaderIndex(this);
|
|
5664
5513
|
if($(e.target).hasClass('colmenuspan')) {
|
|
5665
5514
|
if( !$.jgrid.isNull($("#column_menu")[0]) ) {
|
|
5666
5515
|
$("#column_menu").remove();
|
|
@@ -5683,7 +5532,8 @@ $.fn.jqGrid = function( pin ) {
|
|
|
5683
5532
|
}
|
|
5684
5533
|
//
|
|
5685
5534
|
if (!ts.p.viewsortcols[2]) { r=true;d=t.attr("sort"); }
|
|
5686
|
-
|
|
5535
|
+
sh = $.jgrid.type(ts.p.colModel[ci].sortInHeader) !== 'boolean'? true : ts.p.colModel[ci].sortInHeader
|
|
5536
|
+
if( !$.jgrid.isNull(ci) && sh){
|
|
5687
5537
|
sortData( $('div',this)[0].id, ci, r, d, this);
|
|
5688
5538
|
}
|
|
5689
5539
|
// added aria grid
|
|
@@ -5764,17 +5614,12 @@ $.fn.jqGrid = function( pin ) {
|
|
|
5764
5614
|
$(ts).triggerHandler("jqGridSelectRow", [ri, false, e]);
|
|
5765
5615
|
if( ts.p.onSelectRow) { ts.p.onSelectRow.call(ts, ri, false, e); }
|
|
5766
5616
|
} else {
|
|
5767
|
-
var frz = ts.p.frozenColumns ? ts.p.id+"_frozen" : "";
|
|
5768
5617
|
$(ts.p.selarrrow).each(function(i,n){
|
|
5769
5618
|
var trid = $(ts).jqGrid('getGridRowById',n);
|
|
5770
5619
|
if(trid) {
|
|
5771
5620
|
$( trid ).removeClass(highlight);
|
|
5772
5621
|
}
|
|
5773
5622
|
$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(n))[ts.p.useProp ? 'prop': 'attr']("checked", false);
|
|
5774
|
-
if(frz) {
|
|
5775
|
-
$("#"+$.jgrid.jqID(n), "#"+$.jgrid.jqID(frz)).removeClass(highlight);
|
|
5776
|
-
$("#jqg_"+$.jgrid.jqID(ts.p.id)+"_"+$.jgrid.jqID(n), "#"+$.jgrid.jqID(frz))[ts.p.useProp ? 'prop': 'attr']("checked", false);
|
|
5777
|
-
}
|
|
5778
5623
|
});
|
|
5779
5624
|
ts.p.selarrrow = [];
|
|
5780
5625
|
$(ts).jqGrid("setSelection", ri, selection, e);
|
|
@@ -5958,7 +5803,7 @@ $.fn.jqGrid = function( pin ) {
|
|
|
5958
5803
|
td = e.target;
|
|
5959
5804
|
ptr = $(td,ts.rows).closest("tr.jqgrow");
|
|
5960
5805
|
if($(ptr).length === 0 ){return;}
|
|
5961
|
-
if(!ts.p.multiselect) {
|
|
5806
|
+
if(!ts.p.multiselect && !ts.p.isClipboard) { $(ts).jqGrid("setSelection",ptr[0].id,true,e); }
|
|
5962
5807
|
ri = ptr[0].rowIndex;
|
|
5963
5808
|
ci = $.jgrid.getCellIndex(td);
|
|
5964
5809
|
var rcr = $(ts).triggerHandler("jqGridRightClickRow", [$(ptr).attr("id"),ri,ci,e]);
|
|
@@ -6134,7 +5979,7 @@ $.fn.jqGrid = function( pin ) {
|
|
|
6134
5979
|
gridhbox = $(grid.hDiv).find("div").first();
|
|
6135
5980
|
//ts.p.scrollOffset = vScrollWidth;
|
|
6136
5981
|
// for future implementation
|
|
6137
|
-
if( vScrollWidth > 0 ) vScrollWidth +=
|
|
5982
|
+
if( vScrollWidth > 0 ) vScrollWidth += 1;
|
|
6138
5983
|
if (gridhbox.hasClass("ui-jqgrid-hbox-rtl")) {
|
|
6139
5984
|
$(grid.hDiv).find("div").first().css({paddingLeft: vScrollWidth + "px"});
|
|
6140
5985
|
}
|
|
@@ -6143,9 +5988,9 @@ $.fn.jqGrid = function( pin ) {
|
|
|
6143
5988
|
}
|
|
6144
5989
|
if(ts.p.autoResizing) {
|
|
6145
5990
|
$(ts).on('jqGridAfterGridComplete.setAutoSizeColumns',function(){
|
|
6146
|
-
var arfrozen = false
|
|
5991
|
+
var arfrozen = false; //, focused = false;
|
|
6147
5992
|
if(ts.p.frozenColumns === true) {
|
|
6148
|
-
focused = $(':focus', '.frozen-div').attr("id");
|
|
5993
|
+
//focused = $(':focus', '.frozen-div').attr("id");
|
|
6149
5994
|
$(ts).jqGrid("destroyFrozenColumns");
|
|
6150
5995
|
arfrozen = true;
|
|
6151
5996
|
}
|
|
@@ -6167,11 +6012,6 @@ $.fn.jqGrid = function( pin ) {
|
|
|
6167
6012
|
}
|
|
6168
6013
|
if(arfrozen) {
|
|
6169
6014
|
$(ts).jqGrid("setFrozenColumns");
|
|
6170
|
-
if(focused) {
|
|
6171
|
-
setTimeout(function(){
|
|
6172
|
-
$("#"+focused, '.frozen-div').trigger('focus');
|
|
6173
|
-
},10);
|
|
6174
|
-
}
|
|
6175
6015
|
}
|
|
6176
6016
|
});
|
|
6177
6017
|
}
|
|
@@ -6336,17 +6176,7 @@ $.jgrid.extend({
|
|
|
6336
6176
|
scrGrid(ner);
|
|
6337
6177
|
}
|
|
6338
6178
|
}
|
|
6339
|
-
if($t.p.frozenColumns === true ) {
|
|
6340
|
-
fid = $t.p.id+"_frozen";
|
|
6341
|
-
}
|
|
6342
|
-
if($t.p.frozenRows === true ) {
|
|
6343
|
-
tfid = $t.p.id+"_fr";
|
|
6344
|
-
}
|
|
6345
|
-
|
|
6346
6179
|
if(!$t.p.multiselect) {
|
|
6347
|
-
if(tfid) {
|
|
6348
|
-
$("#"+$.jgrid.jqID($t.p.selrow), "#"+$.jgrid.jqID(tfid)).removeClass(highlight);
|
|
6349
|
-
}
|
|
6350
6180
|
if(pt.className !== "ui-subgrid") {
|
|
6351
6181
|
if( $t.p.selrow !== pt.id ) {
|
|
6352
6182
|
if( isHight ) {
|
|
@@ -6355,10 +6185,6 @@ $.jgrid.extend({
|
|
|
6355
6185
|
$( csr ).removeClass(highlight).attr({"aria-selected":"false" , "tabindex" : "-1"});
|
|
6356
6186
|
}
|
|
6357
6187
|
$(pt).addClass(highlight).attr({"aria-selected":"true" ,"tabindex" : "0"});//.focus();
|
|
6358
|
-
if(fid) {
|
|
6359
|
-
$("#"+$.jgrid.jqID($t.p.selrow), "#"+$.jgrid.jqID(fid)).removeClass(highlight);
|
|
6360
|
-
$("#"+$.jgrid.jqID(selection), "#"+$.jgrid.jqID(fid)).addClass(highlight);
|
|
6361
|
-
}
|
|
6362
6188
|
}
|
|
6363
6189
|
stat = true;
|
|
6364
6190
|
} else {
|
|
@@ -6391,16 +6217,6 @@ $.jgrid.extend({
|
|
|
6391
6217
|
$t.p.selrow = (tpsr === undefined) ? null : tpsr;
|
|
6392
6218
|
}
|
|
6393
6219
|
$("#jqg_"+$.jgrid.jqID($t.p.id)+"_"+$.jgrid.jqID(pt.id))[$t.p.useProp ? 'prop': 'attr']("checked",stat);
|
|
6394
|
-
if(fid) {
|
|
6395
|
-
if(isHight) {
|
|
6396
|
-
if(ia === -1) {
|
|
6397
|
-
$("#"+$.jgrid.jqID(selection), "#"+$.jgrid.jqID(fid)).addClass(highlight);
|
|
6398
|
-
} else {
|
|
6399
|
-
$("#"+$.jgrid.jqID(selection), "#"+$.jgrid.jqID(fid)).removeClass(highlight);
|
|
6400
|
-
}
|
|
6401
|
-
}
|
|
6402
|
-
$("#jqg_"+$.jgrid.jqID($t.p.id)+"_"+$.jgrid.jqID(selection), "#"+$.jgrid.jqID(fid))[$t.p.useProp ? 'prop': 'attr']("checked",stat);
|
|
6403
|
-
}
|
|
6404
6220
|
if( onsr ) {
|
|
6405
6221
|
$($t).triggerHandler("jqGridSelectRow", [pt.id, stat, e]);
|
|
6406
6222
|
if( $t.p.onSelectRow) { $t.p.onSelectRow.call($t, pt.id , stat, e); }
|
|
@@ -6417,16 +6233,12 @@ $.jgrid.extend({
|
|
|
6417
6233
|
getstyle = $.jgrid.getMethod("getStyleUI"),
|
|
6418
6234
|
highlight = getstyle(t.p.styleUI+'.common','highlight', true),
|
|
6419
6235
|
hover = getstyle(t.p.styleUI+'.common','hover', true);
|
|
6420
|
-
if( t.p.frozenColumns === true ) {
|
|
6421
|
-
fid = t.p.id+"_frozen";
|
|
6422
|
-
}
|
|
6423
6236
|
if(rowid !== undefined ) {
|
|
6424
6237
|
sr = rowid === t.p.selrow ? t.p.selrow : rowid;
|
|
6425
6238
|
$("#"+$.jgrid.jqID(t.p.id)+" tbody").first().find("tr#"+$.jgrid.jqID(sr)).removeClass( highlight ).attr("aria-selected","false");
|
|
6426
6239
|
if (fid) { $("#"+$.jgrid.jqID(sr), "#"+$.jgrid.jqID(fid)).removeClass( highlight ); }
|
|
6427
6240
|
if(t.p.multiselect) {
|
|
6428
6241
|
$("#jqg_"+$.jgrid.jqID(t.p.id)+"_"+$.jgrid.jqID(sr), "#"+$.jgrid.jqID(t.p.id))[t.p.useProp ? 'prop': 'attr']("checked",false);
|
|
6429
|
-
if(fid) { $("#jqg_"+$.jgrid.jqID(t.p.id)+"_"+$.jgrid.jqID(sr), "#"+$.jgrid.jqID(fid))[t.p.useProp ? 'prop': 'attr']("checked",false); }
|
|
6430
6242
|
t.setHeadCheckBox( false);
|
|
6431
6243
|
var ia = $.inArray($.jgrid.jqID(sr), t.p.selarrrow);
|
|
6432
6244
|
if ( ia !== -1 ){
|
|
@@ -6438,7 +6250,6 @@ $.jgrid.extend({
|
|
|
6438
6250
|
} else if(!t.p.multiselect) {
|
|
6439
6251
|
if(t.p.selrow) {
|
|
6440
6252
|
$("#"+$.jgrid.jqID(t.p.id)+" tbody").first().find("tr#"+$.jgrid.jqID(t.p.selrow)).removeClass( highlight ).attr("aria-selected","false");
|
|
6441
|
-
if(fid) { $("#"+$.jgrid.jqID(t.p.selrow), "#"+$.jgrid.jqID(fid)).removeClass( highlight ); }
|
|
6442
6253
|
if( t.p.onUnSelectRow) { t.p.onUnSelectRow.call(t, t.p.selrow ); }
|
|
6443
6254
|
t.p.selrow = null;
|
|
6444
6255
|
}
|
|
@@ -6504,7 +6315,7 @@ $.jgrid.extend({
|
|
|
6504
6315
|
} else {
|
|
6505
6316
|
$(ind).children('td[role="gridcell"]').each( function(i) {
|
|
6506
6317
|
nm = $t.p.colModel[i].name;
|
|
6507
|
-
if (
|
|
6318
|
+
if ( !$.jgrid.isServiceCol( nm ) ) {
|
|
6508
6319
|
if($t.p.treeGrid===true && nm === $t.p.ExpandColumn) {
|
|
6509
6320
|
res[nm] = $.jgrid.htmlDecode( $(this).find("span").first().html() );
|
|
6510
6321
|
} else {
|
|
@@ -6556,9 +6367,6 @@ $.jgrid.extend({
|
|
|
6556
6367
|
$t.p.reccount--;
|
|
6557
6368
|
$t.updatepager(true,false);
|
|
6558
6369
|
success=true;
|
|
6559
|
-
if($t.p.frozenColumns) {
|
|
6560
|
-
$("#" + rowid, "#" + $.jgrid.jqID($t.p.id + "_frozen")).remove();
|
|
6561
|
-
}
|
|
6562
6370
|
if($t.p.multiselect) {
|
|
6563
6371
|
ia = $.inArray(rowid,$t.p.selarrrow);
|
|
6564
6372
|
if(ia !== -1) { $t.p.selarrrow.splice(ia,1);}
|
|
@@ -6581,12 +6389,15 @@ $.jgrid.extend({
|
|
|
6581
6389
|
});
|
|
6582
6390
|
return success;
|
|
6583
6391
|
},
|
|
6584
|
-
setRowData : function(rowid, data, cssp, usegetrow) {
|
|
6392
|
+
setRowData : function(rowid, data, cssp, usegetrow, skipformatter) {
|
|
6585
6393
|
var nm, success=true;
|
|
6586
6394
|
this.each(function(){
|
|
6587
6395
|
if(!this.grid) {return false;}
|
|
6588
6396
|
var t = this, vl, ind, lcdata={}, jsondat, title;
|
|
6589
6397
|
ind = $(this).jqGrid('getGridRowById', rowid);
|
|
6398
|
+
if( $.jgrid.type(skipformatter) !== 'boolean') {
|
|
6399
|
+
skipformatter = false;
|
|
6400
|
+
}
|
|
6590
6401
|
if(!ind) {
|
|
6591
6402
|
return false;
|
|
6592
6403
|
}
|
|
@@ -6603,7 +6414,7 @@ $.jgrid.extend({
|
|
|
6603
6414
|
var dval =$.jgrid.getAccessor(data,nm);
|
|
6604
6415
|
if( dval !== undefined) {
|
|
6605
6416
|
lcdata[nm] = dval; //this.formatter && typeof this.formatter === 'string' && this.formatter === 'date' ? $.unformat.date.call(t,dval,this) : dval;
|
|
6606
|
-
vl = t.formatter( rowid, lcdata[nm], i, data, 'edit');
|
|
6417
|
+
vl = !skipformatter ? t.formatter( rowid, lcdata[nm], i, data, 'edit') : dval;
|
|
6607
6418
|
title = this.title ? {"title":$.jgrid.stripHtml(vl)} : {};
|
|
6608
6419
|
|
|
6609
6420
|
if(t.p.treeGrid===true && nm === t.p.ExpandColumn) {
|
|
@@ -6611,9 +6422,6 @@ $.jgrid.extend({
|
|
|
6611
6422
|
} else {
|
|
6612
6423
|
$("td[role='gridcell']",ind).eq(i).html(vl).attr(title);
|
|
6613
6424
|
}
|
|
6614
|
-
if(t.p.frozenColumns && i <= t.p.frozenColCount) {
|
|
6615
|
-
$("#"+rowid+" td[role='gridcell']", "#" + $.jgrid.jqID(t.p.id + "_frozen")).eq(i).html(vl).attr(title);
|
|
6616
|
-
}
|
|
6617
6425
|
}
|
|
6618
6426
|
});
|
|
6619
6427
|
if(t.p.datatype === 'local') {
|
|
@@ -6646,7 +6454,7 @@ $.jgrid.extend({
|
|
|
6646
6454
|
});
|
|
6647
6455
|
return success;
|
|
6648
6456
|
},
|
|
6649
|
-
addRowData : function(rowid,rdata,pos,src) {
|
|
6457
|
+
addRowData : function(rowid, rdata, pos, src, addclass) {
|
|
6650
6458
|
if($.inArray( pos, ["first", "last", "before", "after"] ) === -1) {pos = "last";}
|
|
6651
6459
|
var success = false, nm, row, rnc="", msc="", gi, si, ni,sind, i, v, prp="", aradd, cnm, data, cm, id;
|
|
6652
6460
|
if(rdata) {
|
|
@@ -6664,16 +6472,19 @@ $.jgrid.extend({
|
|
|
6664
6472
|
gi = t.p.multiselect ===true ? 1 :0;
|
|
6665
6473
|
si = t.p.subGrid===true ? 1 :0;
|
|
6666
6474
|
if(!aradd) {
|
|
6667
|
-
if(rowid
|
|
6668
|
-
|
|
6475
|
+
if(rowid != null) {
|
|
6476
|
+
rowid = String(rowid);
|
|
6477
|
+
} else {
|
|
6669
6478
|
rowid = $.jgrid.randId();
|
|
6670
6479
|
if(t.p.keyName !== false) {
|
|
6671
6480
|
cnm = t.p.keyName;
|
|
6672
|
-
if(rdata[0][cnm] !== undefined) {
|
|
6481
|
+
if(rdata[0][cnm] !== undefined) {
|
|
6482
|
+
rowid = rdata[0][cnm];
|
|
6673
6483
|
}
|
|
6674
6484
|
}
|
|
6675
6485
|
}
|
|
6676
|
-
|
|
6486
|
+
}
|
|
6487
|
+
var k = 0, classes = $(t).jqGrid('getStyleUI',t.p.styleUI+".base",'rowBox', true, 'jqgrow ui-row-'+ t.p.direction) + " " + (addclass || ""), lcdata = {},
|
|
6677
6488
|
air = $.jgrid.isFunction(t.p.afterInsertRow) ? true : false;
|
|
6678
6489
|
if(ni) {
|
|
6679
6490
|
rnc = $(t).jqGrid('getStyleUI',t.p.styleUI+".base",'rownumBox', false, 'jqgrid-rownum');
|
|
@@ -6691,11 +6502,13 @@ $.jgrid.extend({
|
|
|
6691
6502
|
rowid = $.jgrid.randId();
|
|
6692
6503
|
}
|
|
6693
6504
|
}
|
|
6694
|
-
catch (e) {
|
|
6505
|
+
catch (e) {
|
|
6506
|
+
rowid = $.jgrid.randId();
|
|
6507
|
+
}
|
|
6695
6508
|
}
|
|
6696
6509
|
id = rowid;
|
|
6697
6510
|
rowid = t.p.idPrefix + rowid;
|
|
6698
|
-
if(ni){
|
|
6511
|
+
if(ni) {
|
|
6699
6512
|
prp = t.formatCol(0,1,'',null,rowid, true);
|
|
6700
6513
|
row[row.length] = "<td role=\"gridcell\" " + rnc +" "+prp+">0</td>";
|
|
6701
6514
|
}
|
|
@@ -6809,10 +6622,6 @@ $.jgrid.extend({
|
|
|
6809
6622
|
res = rowlen ? rowlen : 0;
|
|
6810
6623
|
return false;
|
|
6811
6624
|
}
|
|
6812
|
-
if(t.p.frozenColumns && action !== 'get' && destroyFrozen) {
|
|
6813
|
-
$(t).jqGrid("destroyFrozenColumns");
|
|
6814
|
-
frozen = true;
|
|
6815
|
-
}
|
|
6816
6625
|
success=true;
|
|
6817
6626
|
if(action === 'addrow') {
|
|
6818
6627
|
var test = $(".ui-jqgrid-ftable tr", t.grid.sDiv).eq(0).clone();
|
|
@@ -6853,9 +6662,6 @@ $.jgrid.extend({
|
|
|
6853
6662
|
t.grid.sDiv = null;
|
|
6854
6663
|
t.p.footerrow = false;
|
|
6855
6664
|
}
|
|
6856
|
-
if(frozen) {
|
|
6857
|
-
$(t).jqGrid("setFrozenColumns");
|
|
6858
|
-
}
|
|
6859
6665
|
});
|
|
6860
6666
|
return (action === "get" || action === "getlength") ? res : success;
|
|
6861
6667
|
},
|
|
@@ -6882,10 +6688,6 @@ $.jgrid.extend({
|
|
|
6882
6688
|
res = rowlen ? rowlen : 0;
|
|
6883
6689
|
return true;
|
|
6884
6690
|
}
|
|
6885
|
-
if(t.p.frozenColumns && action !== 'get' && destroyFrozen) {
|
|
6886
|
-
$(t).jqGrid("destroyFrozenColumns");
|
|
6887
|
-
frozen = true;
|
|
6888
|
-
}
|
|
6889
6691
|
success=true;
|
|
6890
6692
|
if(action === 'addrow') {
|
|
6891
6693
|
var test = $(".ui-jqgrid-hrtable tr", t.grid.hrDiv).eq(0).clone();
|
|
@@ -6926,9 +6728,6 @@ $.jgrid.extend({
|
|
|
6926
6728
|
t.grid.hrDiv = null;
|
|
6927
6729
|
t.p.headerrow = false;
|
|
6928
6730
|
}
|
|
6929
|
-
if(frozen) {
|
|
6930
|
-
$(t).jqGrid("setFrozenColumns");
|
|
6931
|
-
}
|
|
6932
6731
|
});
|
|
6933
6732
|
return (action === "get" || action === "getlength") ? res : success;
|
|
6934
6733
|
},
|
|
@@ -7337,11 +7136,6 @@ $.jgrid.extend({
|
|
|
7337
7136
|
$("[id^=jqgh_]",thecol).empty().html(nData).append(ico).append(col_menu);
|
|
7338
7137
|
} catch (er) {}
|
|
7339
7138
|
$t.p.colNames[pos] = nData;
|
|
7340
|
-
if($t.p.frozenColumns) {
|
|
7341
|
-
thecol = $("tr.ui-jqgrid-labels th",$t.grid.fhDiv).eq( pos );
|
|
7342
|
-
ico = $(".s-ico",thecol);
|
|
7343
|
-
$("[id^=jqgh_]",thecol).empty().html(nData).append(ico);
|
|
7344
|
-
}
|
|
7345
7139
|
}
|
|
7346
7140
|
if (prop) {
|
|
7347
7141
|
if(typeof prop === 'string') {$(thecol).addClass(prop);} else {$(thecol).css(prop);}
|
|
@@ -7390,17 +7184,6 @@ $.jgrid.extend({
|
|
|
7390
7184
|
} else if(position === 'right') {
|
|
7391
7185
|
thecol.find("div.ui-th-div").first().empty().removeClass("ui-icon-left").append(htmlcol).append(ico);
|
|
7392
7186
|
}
|
|
7393
|
-
if($t.p.frozenColumns) {
|
|
7394
|
-
thecol = $("tr.ui-jqgrid-labels th", $t.grid.fhDiv).eq( i );
|
|
7395
|
-
htmlcol = $t.p.colNames[i];
|
|
7396
|
-
ico = thecol.find(".s-ico");
|
|
7397
|
-
|
|
7398
|
-
if(position === 'left') {
|
|
7399
|
-
thecol.find("div.ui-th-div").first().empty().addClass("ui-icon-left").append(ico).append(htmlcol);
|
|
7400
|
-
} else if(position === 'right') {
|
|
7401
|
-
thecol.find("div.ui-th-div").first().empty().removeClass("ui-icon-left").append(htmlcol).append(ico);
|
|
7402
|
-
}
|
|
7403
|
-
}
|
|
7404
7187
|
}
|
|
7405
7188
|
});
|
|
7406
7189
|
},
|
|
@@ -7448,10 +7231,6 @@ $.jgrid.extend({
|
|
|
7448
7231
|
if(typeof attrp === 'object') {
|
|
7449
7232
|
$(tcell).attr(attrp);
|
|
7450
7233
|
}
|
|
7451
|
-
if($t.p.frozenColumns && pos <= $t.p.frozenColCount) {
|
|
7452
|
-
var fcell = $(tcell).clone();
|
|
7453
|
-
$("#"+rowid +" td", "#" + $.jgrid.jqID($t.p.id + "_frozen") ).eq( pos ).replaceWith(fcell);
|
|
7454
|
-
}
|
|
7455
7234
|
}
|
|
7456
7235
|
}
|
|
7457
7236
|
}
|
|
@@ -7557,6 +7336,49 @@ $.jgrid.extend({
|
|
|
7557
7336
|
});
|
|
7558
7337
|
return ret;
|
|
7559
7338
|
},
|
|
7339
|
+
setCol : function( col, value) {
|
|
7340
|
+
this.each(function(){
|
|
7341
|
+
var $t=this, pos=-1, cm = $t.p.colModel, nm,vl, title;
|
|
7342
|
+
if(!$t.grid) {return;}
|
|
7343
|
+
if(isNaN(col)) {
|
|
7344
|
+
pos = $.jgrid.getElemByAttrVal(cm, 'name', col, true);
|
|
7345
|
+
nm = col;
|
|
7346
|
+
} else {
|
|
7347
|
+
pos = parseInt(col,10);
|
|
7348
|
+
nm = cm[pos].name;
|
|
7349
|
+
}
|
|
7350
|
+
if( pos >= 0 ) {
|
|
7351
|
+
var ln = $t.rows.length, i = 0;
|
|
7352
|
+
if (ln && ln>0){
|
|
7353
|
+
var fval = $.jgrid.isFunction(value) ? value : function(value, data, rowObj) { return value; },
|
|
7354
|
+
lcd = $t.p.datatype === 'local';
|
|
7355
|
+
for(; i < ln; i++){
|
|
7356
|
+
if($($t.rows[i]).hasClass('jqgrow') && $t.rows[i].id !== "norecs") {
|
|
7357
|
+
var data={};
|
|
7358
|
+
for (let element=0;element<$t.rows[i].cells.length;element++) {
|
|
7359
|
+
if($t.rows[i].cells[element] !== undefined) {
|
|
7360
|
+
data[cm[element].name] = $.unformat.call($t, $t.rows[i].cells[element] ,{rowId:$t.rows[i].id, colModel:cm[pos]},pos);
|
|
7361
|
+
}
|
|
7362
|
+
}
|
|
7363
|
+
vl = fval.call($t, value, data, $t.rows[i]);
|
|
7364
|
+
if(lcd) { // local data
|
|
7365
|
+
let index = $t.p._index[$.jgrid.stripPref($t.p.idPrefix, $t.rows[i].id)];
|
|
7366
|
+
$t.p.data[index][cm[pos].name] = vl;
|
|
7367
|
+
}
|
|
7368
|
+
vl = $t.formatter( $t.rows[i].id, vl, pos, data, 'edit');
|
|
7369
|
+
title = cm[pos].title ? {"title":$.jgrid.stripHtml(vl)} : {};
|
|
7370
|
+
|
|
7371
|
+
if($t.p.treeGrid===true && nm === $t.p.ExpandColumn) {
|
|
7372
|
+
$($t.rows[i].cells[pos]).find("span[class*='cell-wrapper']").html(vl).attr(title);
|
|
7373
|
+
} else {
|
|
7374
|
+
$($t.rows[i].cells[pos]).html(vl).attr(title);
|
|
7375
|
+
}
|
|
7376
|
+
}
|
|
7377
|
+
}
|
|
7378
|
+
}
|
|
7379
|
+
}
|
|
7380
|
+
});
|
|
7381
|
+
},
|
|
7560
7382
|
clearGridData : function(clearfooter, clearheader) {
|
|
7561
7383
|
return this.each(function(){
|
|
7562
7384
|
var $t = this;
|
|
@@ -7775,9 +7597,6 @@ $.jgrid.extend({
|
|
|
7775
7597
|
for ( i=0;i<$t.p.colModel.length;i++ ) {
|
|
7776
7598
|
if ( $t.p.colModel[i].index === colname || $t.p.colModel[i].name === colname ) {
|
|
7777
7599
|
idx = i;
|
|
7778
|
-
if($t.p.frozenColumns === true && $t.p.colModel[i].frozen === true) {
|
|
7779
|
-
sobj = $t.grid.fhDiv.find("#" + $t.p.id + "_" + colname);
|
|
7780
|
-
}
|
|
7781
7600
|
break;
|
|
7782
7601
|
}
|
|
7783
7602
|
}
|
|
@@ -7831,26 +7650,16 @@ $.jgrid.extend({
|
|
|
7831
7650
|
|
|
7832
7651
|
});
|
|
7833
7652
|
},
|
|
7834
|
-
setFrozenColumns : function
|
|
7835
|
-
return this.each(function()
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
hover = $($t).jqGrid('getStyleUI',$t.p.styleUI+".common",'hover', true),
|
|
7840
|
-
borderbox = $("#gbox_"+$.jgrid.jqID($t.p.id)).css("box-sizing") === 'border-box',
|
|
7841
|
-
pixelfix = borderbox ? 1 : 0;
|
|
7842
|
-
// TODO treeGrid and grouping Support
|
|
7843
|
-
if($t.p.subGrid === true ||
|
|
7844
|
-
$t.p.treeGrid === true ||
|
|
7845
|
-
$t.p.cellEdit === true ||
|
|
7846
|
-
/*$t.p.sortable ||*/
|
|
7847
|
-
$t.p.scroll ||
|
|
7848
|
-
$t.p.frozenColumns
|
|
7849
|
-
/* $t.p.grouping === true*/)
|
|
7850
|
-
{
|
|
7851
|
-
return;
|
|
7653
|
+
setFrozenColumns : function(frzclass='frozen-col-class', callername='') {
|
|
7654
|
+
return this.each(function(){
|
|
7655
|
+
//console.trace();
|
|
7656
|
+
if(this.p.direction === "rtl") {
|
|
7657
|
+
frzclass += "-rtl";
|
|
7852
7658
|
}
|
|
7853
|
-
|
|
7659
|
+
if(callername) {
|
|
7660
|
+
console.log("called set from:", callername, frzclass);
|
|
7661
|
+
}
|
|
7662
|
+
var $t = this, cm = $t.p.colModel,i=0, len = cm.length;
|
|
7854
7663
|
$t.p.frozenColCount = -1;
|
|
7855
7664
|
while(i<len)
|
|
7856
7665
|
{
|
|
@@ -7864,230 +7673,98 @@ $.jgrid.extend({
|
|
|
7864
7673
|
i++;
|
|
7865
7674
|
}
|
|
7866
7675
|
if( $t.p.frozenColCount >= 0) {
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
$($t.grid.fhDiv).append(htbl);
|
|
7879
|
-
if( $($t).jqGrid('isGroupHeaderOn') ) {
|
|
7880
|
-
fthh = $("tr.jqg-third-row-header", $t.grid.hDiv).height();
|
|
7881
|
-
$("tr.jqg-first-row-header, tr.jqg-third-row-header", htbl).each(function(){
|
|
7882
|
-
$("th", this).slice( $t.p.frozenColCount + 1 ).remove();
|
|
7883
|
-
});
|
|
7884
|
-
var swapfroz = -1, fdel = -1, cs, rs;
|
|
7885
|
-
$("tr.jqg-second-row-header th", htbl).each(function(){
|
|
7886
|
-
cs= parseInt($(this).attr("colspan"),10);
|
|
7887
|
-
rs= parseInt($(this).attr("rowspan"),10);
|
|
7888
|
-
if(rs) {
|
|
7889
|
-
swapfroz++;
|
|
7890
|
-
fdel++;
|
|
7891
|
-
}
|
|
7892
|
-
if(cs) {
|
|
7893
|
-
swapfroz = swapfroz+cs;
|
|
7894
|
-
fdel++;
|
|
7895
|
-
}
|
|
7896
|
-
if(swapfroz === $t.p.frozenColCount) {
|
|
7897
|
-
fdel = $t.p.frozenColCount;
|
|
7898
|
-
return false;
|
|
7899
|
-
}
|
|
7900
|
-
});
|
|
7901
|
-
if(swapfroz !== $t.p.frozenColCount) {
|
|
7902
|
-
fdel = $t.p.frozenColCount;
|
|
7903
|
-
}
|
|
7904
|
-
$("tr.jqg-second-row-header", htbl).each(function(){
|
|
7905
|
-
$("th", this).slice( fdel + 1 ).remove();
|
|
7906
|
-
});
|
|
7907
|
-
var testws = $("tr.jqg-second-row-header th", htbl).filter( function() {
|
|
7908
|
-
return $(this).css("display") !== "none";
|
|
7909
|
-
}).first();
|
|
7910
|
-
if($.jgrid.type(testws) === 'object' && testws.length && testws.css("visibility") !== 'hidden' && $.jgrid.trim(testws[0].outerText) === "") {
|
|
7911
|
-
testws.html(' ');
|
|
7912
|
-
}
|
|
7913
|
-
testws = $("tr.jqg-third-row-header th", htbl).filter( function() { return $(this).css("display") !== "none"; }).first();
|
|
7914
|
-
if($.jgrid.type(testws) === 'object' && testws.length && testws.css("visibility") !== 'hidden' && $.jgrid.trim(testws[0].outerText) === "") {
|
|
7915
|
-
$("div",testws).prepend(' ');
|
|
7676
|
+
$(this).jqGrid('refreshFrozenColumns', true, true, frzclass);
|
|
7677
|
+
$(this).on('jqGridAfterGridComplete.setFrozenColumns',function(){
|
|
7678
|
+
var pos =0;
|
|
7679
|
+
for(i=0;i<$t.p.frozenColCount+1;i++){
|
|
7680
|
+
// from left
|
|
7681
|
+
var nm = this.id+"_"+cm[i].name;
|
|
7682
|
+
$("#"+$.jgrid.jqID(this.id) +' td[aria-describedby="'+nm+'"]').addClass(frzclass).css("inset-inline-start", pos+"px");
|
|
7683
|
+
pos = pos +$('.ui-jqgrid-htable th#'+nm, "#gbox_" + $.jgrid.jqID(this.p.id)).outerWidth();
|
|
7684
|
+
}
|
|
7685
|
+
if($t.p.grouping) {
|
|
7686
|
+
$("#"+$.jgrid.jqID(this.p.id)+' tr.jqgroup td.for-sticky').addClass(frzclass).css("inset-inline-start", "0");
|
|
7916
7687
|
}
|
|
7917
|
-
} else {
|
|
7918
|
-
var maxdh=[];
|
|
7919
|
-
$("#gview_"+$.jgrid.jqID($t.p.id) +" .ui-jqgrid-htable > thead >tr").each(function(i,n){
|
|
7920
|
-
maxdh.push(parseInt($(this).height(),10));
|
|
7921
|
-
});
|
|
7922
|
-
$("thead >tr",htbl).each(function(){
|
|
7923
|
-
$("th", this).slice( $t.p.frozenColCount + 1 ).remove();
|
|
7924
|
-
});
|
|
7925
|
-
$("thead >tr",htbl).each(function(i){
|
|
7926
|
-
if(i===0) {
|
|
7927
|
-
maxdh[i] -=1;
|
|
7928
|
-
}
|
|
7929
|
-
$(this).height(maxdh[i]);
|
|
7930
|
-
});
|
|
7931
|
-
}
|
|
7932
|
-
//if( fthh ) {
|
|
7933
|
-
//$("tr.jqg-third-row-header th", htbl).eq(0).height(fthh);
|
|
7934
|
-
//}
|
|
7935
|
-
//$(htbl).width(1);
|
|
7936
|
-
if(!$.jgrid.msie()) {
|
|
7937
|
-
$(htbl).css("height","100%");
|
|
7938
|
-
}
|
|
7939
|
-
// resizing stuff
|
|
7940
|
-
$($t.grid.fhDiv)//.append(htbl)
|
|
7941
|
-
.mousemove(function (e) {
|
|
7942
|
-
if($t.grid.resizing){ $t.grid.dragMove(e);return false; }
|
|
7943
7688
|
});
|
|
7944
|
-
|
|
7945
|
-
// disable sortable with mouse on frozen columns
|
|
7946
|
-
$($t.grid.fhDiv).find("tr.ui-jqgrid-labels th").addClass("sortable-disabled");
|
|
7947
|
-
}
|
|
7948
|
-
if($t.p.headerrow) {
|
|
7949
|
-
$t.grid.fhrDiv = $('<div style="position:absolute;' + ($t.p.direction === "rtl" ? 'right:0px;' : 'left:0px;') + 'top:0px;" class="frozen-hrdiv ui-jqgrid-hrdiv "></div>');
|
|
7950
|
-
$("#gview_"+$.jgrid.jqID($t.p.id)).append($t.grid.fhrDiv);
|
|
7951
|
-
}
|
|
7952
|
-
if($t.p.footerrow) {
|
|
7953
|
-
$t.grid.fsDiv = $('<div style="position:absolute;' + ($t.p.direction === "rtl" ? 'right:0px;' : 'left:0px;') + 'top:0px;" class="frozen-sdiv ui-jqgrid-sdiv"></div>');
|
|
7954
|
-
$("#gview_"+$.jgrid.jqID($t.p.id)).append($t.grid.fsDiv);
|
|
7955
|
-
}
|
|
7956
|
-
// data stuff
|
|
7957
|
-
//TODO support for setRowData
|
|
7958
|
-
$("#gview_"+$.jgrid.jqID($t.p.id)).append($t.grid.fbDiv);
|
|
7959
|
-
|
|
7960
|
-
$($t.grid.fbDiv).on('mousewheel DOMMouseScroll', function (e) {
|
|
7961
|
-
$t.grid.bDiv.scrollTop +=
|
|
7962
|
-
e.type === "mousewheel" ?
|
|
7963
|
-
-e.originalEvent.wheelDelta / 10 :
|
|
7964
|
-
e.originalEvent.detail * 6;
|
|
7965
|
-
});
|
|
7966
|
-
|
|
7967
|
-
if($t.p.hoverrows === true) {
|
|
7968
|
-
$("#"+$.jgrid.jqID($t.p.id)).off('mouseover mouseout');
|
|
7969
|
-
}
|
|
7970
|
-
//var hasscroll;
|
|
7971
|
-
$($t).on('jqGridAfterGridComplete.setFrozenColumns', function () {
|
|
7972
|
-
$("#"+$.jgrid.jqID($t.p.id)+"_frozen").remove();
|
|
7973
|
-
|
|
7974
|
-
// hasscroll = parseInt($($t.grid.bDiv)[0].scrollWidth,10) > parseInt($($t.grid.bDiv)[0].clientWidth,10);
|
|
7975
|
-
$($t.grid.fbDiv).height( $($t.grid.bDiv)[0].clientHeight ); //- (hasscroll ? 0 : $t.p.scrollOffset-3));
|
|
7976
|
-
// find max height
|
|
7977
|
-
var mh = [];
|
|
7978
|
-
$("#"+$.jgrid.jqID($t.p.id) + " tr[role=row].jqgrow").each(function(){
|
|
7979
|
-
mh.push( $(this).height() );
|
|
7980
|
-
});
|
|
7981
|
-
|
|
7982
|
-
var btbl = $("#"+$.jgrid.jqID($t.p.id)).clone(true);
|
|
7983
|
-
$("tr[role=row]",btbl).each(function(){
|
|
7984
|
-
$("td[role=gridcell]", this).slice( $t.p.frozenColCount + 1).remove();
|
|
7985
|
-
});
|
|
7986
|
-
|
|
7987
|
-
$(btbl).width(1).attr("id",$t.p.id+"_frozen");
|
|
7988
|
-
$($t.grid.fbDiv).append(btbl);
|
|
7989
|
-
// set the height
|
|
7990
|
-
$("tr[role=row].jqgrow",btbl).each(function(i, n){
|
|
7991
|
-
$(this).height( mh[i] );
|
|
7992
|
-
if( Math.abs($(this).height() - mh[i]) >= 0.3 ) {
|
|
7993
|
-
var tt = $("td:visible", this).first();
|
|
7994
|
-
tt.height(mh[i] - Math.round(parseFloat(tt.css("border-bottom-width")) ));
|
|
7995
|
-
}
|
|
7996
|
-
});
|
|
7997
|
-
if($t.rows[1] && $t.rows[1].id === 'norecs') {
|
|
7998
|
-
$("#norecs td", btbl).html("");
|
|
7999
|
-
}
|
|
8000
|
-
$($t.grid.fbDiv)[0].scrollTop = $($t.grid.bDiv)[0].scrollTop;
|
|
8001
|
-
if($t.p.hoverrows === true) {
|
|
8002
|
-
$("tr.jqgrow", btbl).hover(
|
|
8003
|
-
function(){
|
|
8004
|
-
$(this).addClass( hover );
|
|
8005
|
-
$("#"+$.jgrid.jqID(this.id), "#"+$.jgrid.jqID($t.p.id)).addClass( hover );
|
|
8006
|
-
},function(){
|
|
8007
|
-
$(this).removeClass( hover );
|
|
8008
|
-
$("#"+$.jgrid.jqID(this.id), "#"+$.jgrid.jqID($t.p.id)).removeClass( hover );
|
|
8009
|
-
}
|
|
8010
|
-
);
|
|
8011
|
-
$("tr.jqgrow", "#"+$.jgrid.jqID($t.p.id)).hover(
|
|
8012
|
-
function(){
|
|
8013
|
-
$(this).addClass( hover );
|
|
8014
|
-
$("#"+$.jgrid.jqID(this.id), "#"+$.jgrid.jqID($t.p.id)+"_frozen").addClass( hover );
|
|
8015
|
-
|
|
8016
|
-
},
|
|
8017
|
-
function(){
|
|
8018
|
-
$(this).removeClass( hover );
|
|
8019
|
-
$("#"+$.jgrid.jqID(this.id), "#"+$.jgrid.jqID($t.p.id)+"_frozen").removeClass( hover );
|
|
8020
|
-
}
|
|
8021
|
-
);
|
|
8022
|
-
}
|
|
8023
|
-
//btbl=null;
|
|
8024
|
-
if($t.p.headerrow) {
|
|
8025
|
-
var bhtop = $($t.grid.hrDiv).position();
|
|
8026
|
-
$("table",$t.grid.fhrDiv).remove();
|
|
8027
|
-
var hrtbl = $(".ui-jqgrid-hrtable","#gview_"+$.jgrid.jqID($t.p.id)).clone(true);
|
|
8028
|
-
$("tr",hrtbl).each(function(){
|
|
8029
|
-
$("td", this).slice( $t.p.frozenColCount + 1 ).remove();
|
|
8030
|
-
});
|
|
8031
|
-
$(hrtbl).width(1);
|
|
8032
|
-
$($t.grid.fhrDiv).css("top", bhtop.top+"px").append(hrtbl);
|
|
8033
|
-
}
|
|
8034
|
-
if($t.p.footerrow) {
|
|
8035
|
-
var bttop = $($t.grid.sDiv).position();
|
|
8036
|
-
$("table",$t.grid.fsDiv).remove();
|
|
8037
|
-
var ftbl = $(".ui-jqgrid-ftable","#gview_"+$.jgrid.jqID($t.p.id)).clone(true);
|
|
8038
|
-
$("tr",ftbl).each(function(){
|
|
8039
|
-
$("td", this).slice( $t.p.frozenColCount + 1 ).remove();
|
|
8040
|
-
});
|
|
8041
|
-
$(ftbl).width(1);
|
|
8042
|
-
$($t.grid.fsDiv).css("top", bttop.top+"px").append(ftbl);
|
|
8043
|
-
}
|
|
8044
|
-
});
|
|
8045
|
-
if(!$t.grid.hDiv.loading) {
|
|
8046
|
-
$($t).triggerHandler("jqGridAfterGridComplete.setFrozenColumns");
|
|
8047
|
-
}
|
|
8048
|
-
$t.p.frozenColumns = true;
|
|
8049
|
-
$($t).triggerHandler("onFrozenColumnsCall");
|
|
7689
|
+
this.p.frozenColumns = true;
|
|
8050
7690
|
}
|
|
8051
7691
|
});
|
|
8052
7692
|
},
|
|
8053
|
-
|
|
8054
|
-
return this.each(function()
|
|
8055
|
-
if
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
7693
|
+
refreshFrozenColumns : function (data= true, addfrzclass=false, frzclass='frozen-col-class') {
|
|
7694
|
+
return this.each(function(){
|
|
7695
|
+
if( this.p.direction === "rtl" && frzclass.slice(-4) !== "-rtl") {
|
|
7696
|
+
frzclass += "-rtl";
|
|
7697
|
+
}
|
|
7698
|
+
console.log("called refresh frozen", frzclass);
|
|
7699
|
+
var pos =0, cm = this.p.colModel;
|
|
7700
|
+
var elements =[];
|
|
7701
|
+
for(let i=0;i< this.p.frozenColCount+1; i++){
|
|
7702
|
+
// from left direction only for now
|
|
7703
|
+
if(cm[i].hidden) {
|
|
7704
|
+
continue;
|
|
8065
7705
|
}
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
}
|
|
8070
|
-
|
|
8071
|
-
if(
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
$(ptr).removeClass( hover );
|
|
8083
|
-
}
|
|
8084
|
-
});
|
|
7706
|
+
var nm = this.p.id+"_"+cm[i].name ;
|
|
7707
|
+
if(data) {
|
|
7708
|
+
elements.push('.ui-jqgrid-bdiv td[aria-describedby="'+nm+'"]');
|
|
7709
|
+
}
|
|
7710
|
+
elements.push('.ui-jqgrid-htable th#'+nm);
|
|
7711
|
+
if(this.p.filterToolbar) {
|
|
7712
|
+
elements.push('.ui-jqgrid-htable th#gsh_'+nm);
|
|
7713
|
+
}
|
|
7714
|
+
if(this.p.headerrow) {
|
|
7715
|
+
elements.push('.ui-jqgrid-hrtable td[aria-describedby="'+nm+'"]');
|
|
7716
|
+
}
|
|
7717
|
+
if(this.p.footerrow) {
|
|
7718
|
+
elements.push('.ui-jqgrid-ftable td[aria-describedby="'+nm+'"]');
|
|
7719
|
+
}
|
|
7720
|
+
if($(this).jqGrid('isGroupHeaderOn')) {
|
|
7721
|
+
elements.push('.ui-jqgrid-htable .ui-jqgrid-labels [data-spname="' + cm[i].name + '"]');
|
|
8085
7722
|
}
|
|
8086
|
-
|
|
8087
|
-
this.p.
|
|
7723
|
+
var parse_str = elements.join();
|
|
7724
|
+
let parseobj = $(parse_str, "#gbox_" + $.jgrid.jqID(this.p.id)).css("inset-inline-start", pos+"px");
|
|
7725
|
+
if(addfrzclass) {
|
|
7726
|
+
parseobj.addClass(frzclass);
|
|
7727
|
+
}
|
|
7728
|
+
pos += $('.ui-jqgrid-htable th#'+nm, "#gbox_" + $.jgrid.jqID(this.p.id)).outerWidth();
|
|
7729
|
+
elements =[];
|
|
8088
7730
|
}
|
|
8089
7731
|
});
|
|
7732
|
+
|
|
8090
7733
|
},
|
|
7734
|
+
destroyFrozenColumns : function(frzclass='frozen-col-class') {
|
|
7735
|
+
return this.each(function() {
|
|
7736
|
+
var cm = this.p.colModel;
|
|
7737
|
+
var elements =[];
|
|
7738
|
+
if( this.p.direction === "rtl" && frzclass.slice(-4) !== "-rtl") {
|
|
7739
|
+
frzclass += "-rtl";
|
|
7740
|
+
}
|
|
7741
|
+
console.log("caled unset",frzclass);
|
|
7742
|
+
for(let i=0;i< this.p.frozenColCount+1; i++){
|
|
7743
|
+
// from left direction only for now
|
|
7744
|
+
var nm = this.p.id+"_"+cm[i].name ;
|
|
7745
|
+
elements.push('.ui-jqgrid-bdiv td[aria-describedby="'+nm+'"]');
|
|
7746
|
+
elements.push('.ui-jqgrid-htable th#'+nm);
|
|
7747
|
+
if(this.p.filterToolbar) {
|
|
7748
|
+
elements.push('.ui-jqgrid-htable th#gsh_'+nm);
|
|
7749
|
+
}
|
|
7750
|
+
if(this.p.headerrow) {
|
|
7751
|
+
elements.push('.ui-jqgrid-hrtable td[aria-describedby="'+nm+'"]');
|
|
7752
|
+
}
|
|
7753
|
+
if(this.p.footerrow) {
|
|
7754
|
+
elements.push('.ui-jqgrid-ftable td[aria-describedby="'+nm+'"]');
|
|
7755
|
+
}
|
|
7756
|
+
if($(this).jqGrid('isGroupHeaderOn')) {
|
|
7757
|
+
elements.push('.ui-jqgrid-htable .ui-jqgrid-labels [data-spname="' + cm[i].name + '"]');
|
|
7758
|
+
}
|
|
7759
|
+
var parse_str = elements.join();
|
|
7760
|
+
$(parse_str, "#gbox_" + $.jgrid.jqID(this.p.id)).css("inset-inline-start","").removeClass(frzclass);
|
|
7761
|
+
elements =[];
|
|
7762
|
+
}
|
|
7763
|
+
$(this).off('jqGridAfterGridComplete.setFrozenColumns');
|
|
7764
|
+
this.p.frozenColumns = false;
|
|
7765
|
+
this.p.frozenColCount = -1;
|
|
7766
|
+
});
|
|
7767
|
+
},
|
|
8091
7768
|
resizeColumn : function ( iCol, newWidth, forceresize, setfrozen ) {
|
|
8092
7769
|
return this.each(function() {
|
|
8093
7770
|
var tgrid = this.grid, pr = this.p,
|
|
@@ -8218,9 +7895,6 @@ $.jgrid.extend({
|
|
|
8218
7895
|
}
|
|
8219
7896
|
$("#"+$.jgrid.jqID($t.p.id)).jqGrid('setGridHeight', wh - bstw, true, false);
|
|
8220
7897
|
}
|
|
8221
|
-
if($t.p.frozenRows) {
|
|
8222
|
-
$($t).trigger('jqGridAfterGridComplete.setFrozenRows');
|
|
8223
|
-
}
|
|
8224
7898
|
if(frozen) {
|
|
8225
7899
|
$("#"+$.jgrid.jqID($t.p.id)).jqGrid("setFrozenColumns");
|
|
8226
7900
|
}
|
|
@@ -8255,12 +7929,15 @@ $.jgrid.extend({
|
|
|
8255
7929
|
}
|
|
8256
7930
|
});
|
|
8257
7931
|
},
|
|
8258
|
-
menubarAdd : function( items ) {
|
|
7932
|
+
menubarAdd : function( items, target ) {
|
|
8259
7933
|
var currstyle = this[0].p.styleUI,
|
|
8260
7934
|
styles = $.jgrid.styleUI[currstyle].common, item, str;
|
|
8261
7935
|
|
|
8262
7936
|
return this.each(function(){
|
|
8263
7937
|
var $t = this;
|
|
7938
|
+
if(target === undefined) {
|
|
7939
|
+
target = "_menubar";
|
|
7940
|
+
}
|
|
8264
7941
|
if( Array.isArray(items)) {
|
|
8265
7942
|
for(var i = 0; i < items.length; i++) {
|
|
8266
7943
|
item = items[i];
|
|
@@ -8285,13 +7962,13 @@ $.jgrid.extend({
|
|
|
8285
7962
|
str = '<li class="ui-menu-item" role="presentation"><a id="'+ item.id+'" class="g-menu-item" tabindex="0" role="menuitem" ><table class="ui-common-table"><tr><td class="menu_icon">'+ico+'</td><td class="menu_text">'+item.title+'</td></tr></table></a></li>';
|
|
8286
7963
|
}
|
|
8287
7964
|
if(item.position === 'last') {
|
|
8288
|
-
$("#"+this.p.id+
|
|
7965
|
+
$("#"+this.p.id + target).append(str);
|
|
8289
7966
|
} else {
|
|
8290
|
-
$("#"+this.p.id+
|
|
7967
|
+
$("#"+this.p.id + target).prepend(str);
|
|
8291
7968
|
}
|
|
8292
7969
|
}
|
|
8293
7970
|
}
|
|
8294
|
-
$("li a", "#"+this.p.id+
|
|
7971
|
+
$("li a", "#"+this.p.id + target).each(function(i,n){
|
|
8295
7972
|
$(items).each(function(j,f){
|
|
8296
7973
|
if(f.id === n.id && $.jgrid.isFunction(f.click)) {
|
|
8297
7974
|
$(n).on('click', function(e){
|
|
@@ -8310,9 +7987,12 @@ $.jgrid.extend({
|
|
|
8310
7987
|
});
|
|
8311
7988
|
});
|
|
8312
7989
|
},
|
|
8313
|
-
menubarDelete : function( itemid ) {
|
|
7990
|
+
menubarDelete : function( itemid, target ) {
|
|
8314
7991
|
return this.each(function(){
|
|
8315
|
-
|
|
7992
|
+
if(target === undefined) {
|
|
7993
|
+
target = "_menubar";
|
|
7994
|
+
}
|
|
7995
|
+
$("#"+itemid, "#"+this.p.id + target).remove();
|
|
8316
7996
|
});
|
|
8317
7997
|
},
|
|
8318
7998
|
addColSearchMenu : function() {
|
|
@@ -9299,7 +8979,9 @@ $.extend($.jgrid,{
|
|
|
9299
8979
|
onHide: $.jgrid.closeModal,
|
|
9300
8980
|
gbox: '',
|
|
9301
8981
|
jqm : true,
|
|
9302
|
-
jqM : true
|
|
8982
|
+
jqM : true
|
|
8983
|
+
//duration : 400,
|
|
8984
|
+
//easing: "swing"
|
|
9303
8985
|
}, o || {});
|
|
9304
8986
|
var style="";
|
|
9305
8987
|
if(o.gbox) {
|
|
@@ -9358,7 +9040,10 @@ $.extend($.jgrid,{
|
|
|
9358
9040
|
buttonalign : 'center',
|
|
9359
9041
|
buttons : [],
|
|
9360
9042
|
overlay : 10,
|
|
9361
|
-
overlayClass : ''
|
|
9043
|
+
overlayClass : '',
|
|
9044
|
+
autoClose : false,
|
|
9045
|
+
autoCloseTime: 3500,
|
|
9046
|
+
position : ""
|
|
9362
9047
|
// {text:'textbutt', id:"buttid", onClick : function(){...}}
|
|
9363
9048
|
// if the id is not provided we set it like info_button_+ the index in the array - i.e info_button_0,info_button_1...
|
|
9364
9049
|
};
|
|
@@ -9378,12 +9063,12 @@ $.extend($.jgrid,{
|
|
|
9378
9063
|
buttstr += "<a id='"+mopt.buttons[i].id+"' class='fm-button " + common.button+"'>"+mopt.buttons[i].text+"</a>";
|
|
9379
9064
|
}
|
|
9380
9065
|
}
|
|
9381
|
-
var dh = isNaN(mopt.dataheight) ? mopt.dataheight : mopt.dataheight+"px"
|
|
9382
|
-
cn = "text-align:"+mopt.align+";";
|
|
9066
|
+
var dh = isNaN(mopt.dataheight) ? mopt.dataheight : mopt.dataheight+"px";
|
|
9067
|
+
//cn = "text-align:"+mopt.align+";";
|
|
9383
9068
|
var cnt = "<div id='info_id'>";
|
|
9384
|
-
cnt += "<div id='infocnt' class='"+classes.body+"'
|
|
9385
|
-
cnt += c_b ? "<div class='" + classes.footer + "'
|
|
9386
|
-
buttstr !== "" ? "<div class='" + classes.footer + "'
|
|
9069
|
+
cnt += "<div id='infocnt' class='info_content "+classes.body+"'>"+content+"</div>";
|
|
9070
|
+
cnt += c_b ? "<div class='info_footer " + classes.footer + "'><a id='closedialog' class='fm-button " + common.button + "'>"+c_b+"</a>"+buttstr+"</div>" :
|
|
9071
|
+
buttstr !== "" ? "<div class='info_footer " + classes.footer + "'>"+buttstr+"</div>" : "";
|
|
9387
9072
|
cnt += "</div>";
|
|
9388
9073
|
|
|
9389
9074
|
try {
|
|
@@ -9403,6 +9088,43 @@ $.extend($.jgrid,{
|
|
|
9403
9088
|
'','',true,
|
|
9404
9089
|
{ "font-size":fs}
|
|
9405
9090
|
);
|
|
9091
|
+
if(mopt.position) {
|
|
9092
|
+
var inf_dlg_pos = mopt.position.split(" "), d_clas;
|
|
9093
|
+
switch (inf_dlg_pos[0].toLowerCase() + " " + inf_dlg_pos[1].toLowerCase() )
|
|
9094
|
+
{
|
|
9095
|
+
case 'top left':
|
|
9096
|
+
d_clas = 'top-0 start-0';
|
|
9097
|
+
break;
|
|
9098
|
+
case 'top center':
|
|
9099
|
+
d_clas = 'top-0 start-50 translate-middle-x';
|
|
9100
|
+
break;
|
|
9101
|
+
case 'top right':
|
|
9102
|
+
d_clas = 'top-0 end-0';
|
|
9103
|
+
break;
|
|
9104
|
+
case 'middle left':
|
|
9105
|
+
d_clas = 'top-50 start-0 translate-middle-y';
|
|
9106
|
+
break;
|
|
9107
|
+
case 'middle center':
|
|
9108
|
+
d_clas = 'top-50 start-50 translate-middle';
|
|
9109
|
+
break;
|
|
9110
|
+
case 'middle right':
|
|
9111
|
+
d_clas = 'top-50 end-0 translate-middle-y';
|
|
9112
|
+
break;
|
|
9113
|
+
case 'bottom left':
|
|
9114
|
+
d_clas = 'bottom-0 start-0';
|
|
9115
|
+
break;
|
|
9116
|
+
case 'bottom center':
|
|
9117
|
+
d_clas = 'bottom-0 start-50 translate-middle-x';
|
|
9118
|
+
break;
|
|
9119
|
+
case 'bottom right':
|
|
9120
|
+
d_clas = 'bottom-0 end-0';
|
|
9121
|
+
break;
|
|
9122
|
+
default :
|
|
9123
|
+
d_clas = 'top-50 start-50 translate-middle';
|
|
9124
|
+
}
|
|
9125
|
+
$("#info_dialog").addClass(d_clas).css({"top":"", "left":"", "width":"auto", "max-width": "500px"});
|
|
9126
|
+
}
|
|
9127
|
+
$(".info_content","#info_id").height(dh);
|
|
9406
9128
|
// attach onclick after inserting into the dom
|
|
9407
9129
|
if(buttstr) {
|
|
9408
9130
|
$.each(mopt.buttons,function(i){
|
|
@@ -9417,24 +9139,64 @@ $.extend($.jgrid,{
|
|
|
9417
9139
|
});
|
|
9418
9140
|
return false;
|
|
9419
9141
|
});
|
|
9142
|
+
if(mopt.autoClose) {
|
|
9143
|
+
setTimeout(function() {
|
|
9144
|
+
$(".ui-jqdialog-titlebar-close", "#info_head").trigger('click');
|
|
9145
|
+
}, mopt.autoCloseTime)
|
|
9146
|
+
}
|
|
9420
9147
|
$(".fm-button","#info_dialog").hover(
|
|
9421
9148
|
function(){$(this).addClass(common.hover);},
|
|
9422
9149
|
function(){$(this).removeClass(common.hover);}
|
|
9423
9150
|
);
|
|
9424
9151
|
if($.jgrid.isFunction(mopt.beforeOpen) ) { mopt.beforeOpen(); }
|
|
9152
|
+
if(mopt.type && mopt.type !== "default") {
|
|
9153
|
+
$("#info_dialog").addClass("toast-"+mopt.type)
|
|
9154
|
+
}
|
|
9425
9155
|
$.jgrid.viewModal("#info_dialog",{
|
|
9426
9156
|
onHide: function(h) {
|
|
9427
|
-
|
|
9428
|
-
|
|
9157
|
+
$.jgrid.closeModal(h);
|
|
9158
|
+
h.w.remove();
|
|
9159
|
+
//if(h.o) { h.o.remove(); }
|
|
9429
9160
|
},
|
|
9430
9161
|
modal :mopt.modal,
|
|
9431
9162
|
jqm:jm,
|
|
9432
9163
|
overlay : mopt.overlay,
|
|
9433
9164
|
overlayClass : mopt.overlayClass
|
|
9165
|
+
//duration : mopt.duration || 400,
|
|
9166
|
+
//easing: mopt.easing || "swing"
|
|
9434
9167
|
});
|
|
9435
9168
|
if($.jgrid.isFunction(mopt.afterOpen) ) { mopt.afterOpen(); }
|
|
9436
9169
|
try{ $("#info_dialog").focus();} catch (m){}
|
|
9437
9170
|
},
|
|
9171
|
+
toast : function( o ) {
|
|
9172
|
+
var opt = {
|
|
9173
|
+
caption : "",
|
|
9174
|
+
text :"",
|
|
9175
|
+
close_icon : true,
|
|
9176
|
+
type: "default", //error, warning, info, success
|
|
9177
|
+
close_button : '',
|
|
9178
|
+
autoClose : true,
|
|
9179
|
+
autoCloseTime : 2000,
|
|
9180
|
+
drag: false,
|
|
9181
|
+
position : "middle center",
|
|
9182
|
+
jqModal:false,
|
|
9183
|
+
duration:600,
|
|
9184
|
+
removemodal : true
|
|
9185
|
+
};
|
|
9186
|
+
$.extend(true, opt, $.jgrid.jqModal || {}, {caption: opt.caption }, o || {});
|
|
9187
|
+
if(!opt.text) {
|
|
9188
|
+
return;
|
|
9189
|
+
}
|
|
9190
|
+
$.jgrid.info_dialog(opt.header, opt.text, opt.close_button, opt);
|
|
9191
|
+
if(!opt.caption) {
|
|
9192
|
+
$(".ui-jqdialog-titlebar","#info_dialog").hide();
|
|
9193
|
+
if(opt.close_icon) {
|
|
9194
|
+
var close_but = $(".ui-jqdialog-titlebar-close","#info_dialog").clone(true);
|
|
9195
|
+
$(close_but).insertAfter($("#infocnt"));
|
|
9196
|
+
$("#info_id").css({"padding-right": "35px", "padding-left": "20px"});
|
|
9197
|
+
}
|
|
9198
|
+
}
|
|
9199
|
+
},
|
|
9438
9200
|
bindEv: function (el, opt) {
|
|
9439
9201
|
var $t = this;
|
|
9440
9202
|
if($.jgrid.isFunction(opt.dataInit)) {
|
|
@@ -10915,13 +10677,7 @@ $.jgrid.extend({
|
|
|
10915
10677
|
var $elem, fcol = false;
|
|
10916
10678
|
nm = this.index || this.name;
|
|
10917
10679
|
sop = this.searchoptions || {};
|
|
10918
|
-
|
|
10919
|
-
if(this.frozen===true && $t.p.frozenColumns === true) {
|
|
10920
|
-
$elem = $("#gs_"+ $t.p.idPrefix + $.jgrid.jqID(this.name), $t.grid.fhDiv );
|
|
10921
|
-
fcol = true;
|
|
10922
|
-
} else {
|
|
10923
10680
|
$elem = $("#gs_"+ $t.p.idPrefix + $.jgrid.jqID(this.name), $t.grid.hDiv);
|
|
10924
|
-
}
|
|
10925
10681
|
//var $elem = $("#gs_"+ $t.p.idPrefix + $.jgrid.jqID(this.name), ? $t.grid.fhDiv : $t.grid.hDiv);
|
|
10926
10682
|
// in case frozen col is outside the rule list
|
|
10927
10683
|
if($elem[0] === undefined) {
|
|
@@ -10966,7 +10722,7 @@ $.jgrid.extend({
|
|
|
10966
10722
|
if(so==="bt") {
|
|
10967
10723
|
bbt = true;
|
|
10968
10724
|
}
|
|
10969
|
-
if(
|
|
10725
|
+
if( !$.jgrid.isServiceCol( nm ) /*(nm !== 'cb' && nm!== 'rn' && nm !== 'subgrid' && nm !== 'sc')*/ ) {
|
|
10970
10726
|
afrcol[nm] = v;
|
|
10971
10727
|
}
|
|
10972
10728
|
if(v || so==="nu" || so==="nn" || $.inArray(so, unaryOpers) >=0) {
|
|
@@ -11076,21 +10832,19 @@ $.jgrid.extend({
|
|
|
11076
10832
|
saveurl = $t.p.url;
|
|
11077
10833
|
$($t).jqGrid("setGridParam", { url: p.url });
|
|
11078
10834
|
}
|
|
10835
|
+
var ae = document.activeElement;
|
|
11079
10836
|
var bsr = $($t).triggerHandler("jqGridToolbarBeforeSearch") === 'stop' ? true : false;
|
|
11080
10837
|
if(!bsr && $.jgrid.isFunction(p.beforeSearch)){bsr = p.beforeSearch.call($t);}
|
|
11081
10838
|
if(!bsr) { $($t).jqGrid("setGridParam",{search:sd}).trigger("reloadGrid",[ { page: currentPage } ] ); }
|
|
11082
10839
|
if(saveurl) {$($t).jqGrid("setGridParam",{url:saveurl});}
|
|
11083
10840
|
$($t).triggerHandler("jqGridToolbarAfterSearch");
|
|
11084
10841
|
if($.jgrid.isFunction(p.afterSearch)){p.afterSearch.call($t);}
|
|
11085
|
-
if($t.p.frozenColumns) {
|
|
11086
|
-
setToolbarFozenVal(afrcol,sopt,ssfield, arcustom );
|
|
11087
|
-
}
|
|
11088
10842
|
},
|
|
11089
10843
|
clearToolbar = function(trigger){
|
|
11090
10844
|
var sdata={}, so={}, j=0, nm, $elem, v;
|
|
11091
10845
|
trigger = (typeof trigger !== 'boolean') ? true : trigger;
|
|
11092
10846
|
$.each($t.p.colModel,function(){
|
|
11093
|
-
$elem = $("#gs_"+$t.p.idPrefix+$.jgrid.jqID(this.name),
|
|
10847
|
+
$elem = $("#gs_"+$t.p.idPrefix+$.jgrid.jqID(this.name), $t.grid.hDiv);
|
|
11094
10848
|
if(this.searchoptions && this.searchoptions.defaultValue !== undefined) {
|
|
11095
10849
|
v = this.searchoptions.defaultValue;
|
|
11096
10850
|
} else {
|
|
@@ -11148,7 +10902,7 @@ $.jgrid.extend({
|
|
|
11148
10902
|
ruleGroup += "\"data\":\"" + n.replace(/\\/g,'\\\\').replace(/\"/g,'\\"') + "\"}";
|
|
11149
10903
|
gi++;
|
|
11150
10904
|
if(p.searchOperators) {
|
|
11151
|
-
$elem = $("#gs_"+$t.p.idPrefix+$.jgrid.jqID(i),
|
|
10905
|
+
$elem = $("#gs_"+$t.p.idPrefix+$.jgrid.jqID(i), $t.grid.hDiv);
|
|
11152
10906
|
$elem.parents("table.ui-search-table").find("td.ui-search-oper").children("a").attr("soper", so[i]).html(p.operands[so[i]]);
|
|
11153
10907
|
}
|
|
11154
10908
|
});
|
|
@@ -11189,17 +10943,11 @@ $.jgrid.extend({
|
|
|
11189
10943
|
},
|
|
11190
10944
|
toggleToolbar = function(){
|
|
11191
10945
|
var trow = $("tr.ui-search-toolbar",$t.grid.hDiv);
|
|
11192
|
-
if($t.p.frozenColumns === true) {
|
|
11193
|
-
$($t).jqGrid('destroyFrozenColumns');
|
|
11194
|
-
}
|
|
11195
10946
|
if(trow.css("display") === 'none') {
|
|
11196
10947
|
trow.show();
|
|
11197
10948
|
} else {
|
|
11198
10949
|
trow.hide();
|
|
11199
10950
|
}
|
|
11200
|
-
if($t.p.frozenColumns === true) {
|
|
11201
|
-
$($t).jqGrid("setFrozenColumns");
|
|
11202
|
-
}
|
|
11203
10951
|
},
|
|
11204
10952
|
buildRuleMenu = function( elem, left, top ){
|
|
11205
10953
|
$("#sopt_menu").remove();
|
|
@@ -11248,38 +10996,6 @@ $.jgrid.extend({
|
|
|
11248
10996
|
}
|
|
11249
10997
|
}
|
|
11250
10998
|
});
|
|
11251
|
-
},
|
|
11252
|
-
setToolbarFozenVal = function( ffields, soper, smultiselect, arcustom) {
|
|
11253
|
-
var orgCol = $(".ui-search-toolbar", $t.grid.hDiv),
|
|
11254
|
-
frozenCol = $(".ui-search-toolbar", $t.grid.fhDiv);
|
|
11255
|
-
$.each(ffields, function(i,n){
|
|
11256
|
-
// multiselect
|
|
11257
|
-
// operations
|
|
11258
|
-
if(p.searchOperators) {
|
|
11259
|
-
var oper = soper[i];
|
|
11260
|
-
if(oper) {
|
|
11261
|
-
$(".ui-search-table .ui-search-oper [colname='userId']", orgCol).attr({'soper': oper}).text( p.operands[oper]);
|
|
11262
|
-
$(".ui-search-table .ui-search-oper [colname='userId']", frozenCol).attr({'soper': oper}).text( p.operands[oper]);
|
|
11263
|
-
}
|
|
11264
|
-
}
|
|
11265
|
-
// custom element
|
|
11266
|
-
if( $.inArray(i, arcustom) > -1) {
|
|
11267
|
-
var col = $.jgrid.getElemByAttrVal( $t.p.colModel, 'name', i );
|
|
11268
|
-
if ( col && col.searchoptions ) {
|
|
11269
|
-
var soptf = col.searchoptions || {};
|
|
11270
|
-
if( $.jgrid.isFunction( soptf.custom_value ) ) {
|
|
11271
|
-
var $elem = $("#gs_"+ $t.p.idPrefix + $.jgrid.jqID(i), $t.grid.fhDiv ),
|
|
11272
|
-
$elem2 = $("#gs_"+ $t.p.idPrefix + $.jgrid.jqID(i), $t.grid.hDiv);
|
|
11273
|
-
|
|
11274
|
-
soptf.custom_value.call($t, $elem, "set", n);
|
|
11275
|
-
soptf.custom_value.call($t, $elem2, "set", n);
|
|
11276
|
-
}
|
|
11277
|
-
}
|
|
11278
|
-
} else {
|
|
11279
|
-
$("#gs_"+ $t.p.idPrefix + $.jgrid.jqID(i), orgCol).val( n );
|
|
11280
|
-
$("#gs_"+ $t.p.idPrefix + $.jgrid.jqID(i), frozenCol).val( n );
|
|
11281
|
-
}
|
|
11282
|
-
});
|
|
11283
10999
|
};
|
|
11284
11000
|
// create the row
|
|
11285
11001
|
var tr = $("<tr class='ui-search-toolbar' role='row'></tr>"),
|
|
@@ -12775,6 +12491,9 @@ $.jgrid.extend({
|
|
|
12775
12491
|
}
|
|
12776
12492
|
rp_ge[$t.p.id].processing=false;
|
|
12777
12493
|
try{$(':input:visible',frmgr)[0].focus();} catch (e){}
|
|
12494
|
+
},
|
|
12495
|
+
complete : function() {
|
|
12496
|
+
rp_ge[$t.p.id].processing=false;
|
|
12778
12497
|
}
|
|
12779
12498
|
}, $.jgrid.ajaxOptions, rp_ge[$t.p.id].ajaxEditOptions );
|
|
12780
12499
|
|
|
@@ -13877,7 +13596,7 @@ $.jgrid.extend({
|
|
|
13877
13596
|
else {
|
|
13878
13597
|
if(ajaxOptions.url === "clientArray") {
|
|
13879
13598
|
postd = ajaxOptions.data;
|
|
13880
|
-
ajaxOptions.success({status:200, statusText:''}
|
|
13599
|
+
ajaxOptions.success(postdata,'',{status:200, statusText:''});
|
|
13881
13600
|
} else if( ajaxOptions.url === "storage") {
|
|
13882
13601
|
$($t).jqGrid('deleteStorageRecord', postdata)
|
|
13883
13602
|
.then(function(e){
|
|
@@ -14632,6 +14351,8 @@ $.jgrid.extend({
|
|
|
14632
14351
|
displayField: [],
|
|
14633
14352
|
groupSummaryPos:[],
|
|
14634
14353
|
formatDisplayField : [],
|
|
14354
|
+
prepareGroupField : null,
|
|
14355
|
+
groupRowNumbers : false,
|
|
14635
14356
|
_locgr : false
|
|
14636
14357
|
}, true);
|
|
14637
14358
|
});
|
|
@@ -14671,12 +14392,17 @@ $.jgrid.extend({
|
|
|
14671
14392
|
if( !grp.groupSummaryPos[i]) {
|
|
14672
14393
|
grp.groupSummaryPos[i] = 'footer';
|
|
14673
14394
|
}
|
|
14395
|
+
let vi = $.jgrid.getElemByAttrVal($t.p.colModel, 'name', grp.groupField[i], false).hidden;
|
|
14674
14396
|
if(grp.groupColumnShow[i] === true) {
|
|
14675
14397
|
grp.visibiltyOnNextGrouping[i] = true;
|
|
14676
|
-
|
|
14398
|
+
if(vi) {
|
|
14399
|
+
$($t).jqGrid('showCol',grp.groupField[i]);
|
|
14400
|
+
}
|
|
14677
14401
|
} else {
|
|
14678
14402
|
grp.visibiltyOnNextGrouping[i] = $("#"+$.jgrid.jqID($t.p.id+"_"+grp.groupField[i])).is(":visible");
|
|
14679
|
-
|
|
14403
|
+
if(!vi) {
|
|
14404
|
+
$($t).jqGrid('hideCol',grp.groupField[i]);
|
|
14405
|
+
}
|
|
14680
14406
|
}
|
|
14681
14407
|
}
|
|
14682
14408
|
grp.summary =[];
|
|
@@ -14719,6 +14445,7 @@ $.jgrid.extend({
|
|
|
14719
14445
|
}
|
|
14720
14446
|
},
|
|
14721
14447
|
grlen = grp.groupField.length,
|
|
14448
|
+
formatVal = $.jgrid.isFunction(grp.prepareGroupField),
|
|
14722
14449
|
fieldName,
|
|
14723
14450
|
v,
|
|
14724
14451
|
displayName,
|
|
@@ -14729,7 +14456,9 @@ $.jgrid.extend({
|
|
|
14729
14456
|
displayName = grp.displayField[i];
|
|
14730
14457
|
v = record[fieldName];
|
|
14731
14458
|
displayValue = displayName == null ? null : record[displayName];
|
|
14732
|
-
|
|
14459
|
+
if( formatVal ) {
|
|
14460
|
+
v = grp.prepareGroupField(v, fieldName, record);
|
|
14461
|
+
}
|
|
14733
14462
|
if( displayValue == null ) {
|
|
14734
14463
|
displayValue = v;
|
|
14735
14464
|
}
|
|
@@ -14739,8 +14468,6 @@ $.jgrid.extend({
|
|
|
14739
14468
|
grp.groups.push({idx:i,dataIndex:fieldName,value:v, displayValue: displayValue, startRow: irow, cnt:1, summary : [] } );
|
|
14740
14469
|
grp.lastvalues[i] = v;
|
|
14741
14470
|
grp.counters[i] = {cnt:1, pos:grp.groups.length-1, summary: $.extend(true,[],grp.summary)};
|
|
14742
|
-
$.each(grp.counters[i].summary, sumGroups);
|
|
14743
|
-
grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary;
|
|
14744
14471
|
} else {
|
|
14745
14472
|
if (typeof v !== "object" && (Array.isArray(grp.isInTheSameGroup) && $.jgrid.isFunction(grp.isInTheSameGroup[i]) ? ! grp.isInTheSameGroup[i].call($t, grp.lastvalues[i], v, i, grp): grp.lastvalues[i] !== v)) {
|
|
14746
14473
|
// This record is not in same group as previous one
|
|
@@ -14748,24 +14475,20 @@ $.jgrid.extend({
|
|
|
14748
14475
|
grp.lastvalues[i] = v;
|
|
14749
14476
|
changed = 1;
|
|
14750
14477
|
grp.counters[i] = {cnt:1, pos:grp.groups.length-1, summary: $.extend(true,[],grp.summary)};
|
|
14751
|
-
$.each(grp.counters[i].summary, sumGroups);
|
|
14752
|
-
grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary;
|
|
14753
14478
|
} else {
|
|
14754
14479
|
if (changed === 1) {
|
|
14755
14480
|
// This group has changed because an earlier group changed.
|
|
14756
14481
|
grp.groups.push({idx:i,dataIndex:fieldName,value:v, displayValue: displayValue, startRow: irow, cnt:1, summary : [] } );
|
|
14757
14482
|
grp.lastvalues[i] = v;
|
|
14758
14483
|
grp.counters[i] = {cnt:1, pos:grp.groups.length-1, summary: $.extend(true,[],grp.summary)};
|
|
14759
|
-
$.each(grp.counters[i].summary, sumGroups);
|
|
14760
|
-
grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary;
|
|
14761
14484
|
} else {
|
|
14762
14485
|
grp.counters[i].cnt += 1;
|
|
14763
14486
|
grp.groups[grp.counters[i].pos].cnt = grp.counters[i].cnt;
|
|
14764
|
-
$.each(grp.counters[i].summary, sumGroups);
|
|
14765
|
-
grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary;
|
|
14766
14487
|
}
|
|
14767
14488
|
}
|
|
14768
14489
|
}
|
|
14490
|
+
$.each(grp.counters[i].summary, sumGroups);
|
|
14491
|
+
grp.groups[grp.counters[i].pos].summary = grp.counters[i].summary;
|
|
14769
14492
|
}
|
|
14770
14493
|
}
|
|
14771
14494
|
//gdata.push( rData );
|
|
@@ -14797,10 +14520,7 @@ $.jgrid.extend({
|
|
|
14797
14520
|
showData,
|
|
14798
14521
|
collapsed = false,
|
|
14799
14522
|
footLevel,
|
|
14800
|
-
skip = false
|
|
14801
|
-
frz = $t.p.frozenColumns ? $t.p.id+"_frozen" : false,
|
|
14802
|
-
tar2 = frz ? $("#"+$.jgrid.jqID(hid), "#"+$.jgrid.jqID(frz) ) : false,
|
|
14803
|
-
r2 = (tar2 && tar2.length) ? tar2[0].nextSibling : null;
|
|
14523
|
+
skip = false;
|
|
14804
14524
|
if( tarspan.hasClass(minus) ) {
|
|
14805
14525
|
if(r){
|
|
14806
14526
|
while(r) {
|
|
@@ -14814,13 +14534,7 @@ $.jgrid.extend({
|
|
|
14814
14534
|
if( !skip) {
|
|
14815
14535
|
$(r).hide();
|
|
14816
14536
|
}
|
|
14817
|
-
r = r.nextSibling;
|
|
14818
|
-
if(frz) {
|
|
14819
|
-
if(!skip) {
|
|
14820
|
-
$(r2).hide();
|
|
14821
|
-
}
|
|
14822
|
-
r2 = r2.nextSibling;
|
|
14823
|
-
}
|
|
14537
|
+
r = r.nextSibling;
|
|
14824
14538
|
}
|
|
14825
14539
|
}
|
|
14826
14540
|
tarspan.removeClass(minus).addClass(plus);
|
|
@@ -14842,41 +14556,20 @@ $.jgrid.extend({
|
|
|
14842
14556
|
if (itemGroupingLevel === num + 1) {
|
|
14843
14557
|
if(!skip) {
|
|
14844
14558
|
$(r).show().find(">td>span."+"tree-wrap-"+$t.p.direction).removeClass(minus).addClass(plus);
|
|
14845
|
-
if(frz) {
|
|
14846
|
-
$(r2).show().find(">td>span."+"tree-wrap-"+$t.p.direction).removeClass(minus).addClass(plus);
|
|
14847
|
-
}
|
|
14848
14559
|
}
|
|
14849
14560
|
}
|
|
14850
14561
|
} else if (showData) {
|
|
14851
14562
|
if(!skip) {
|
|
14852
14563
|
$(r).show();
|
|
14853
|
-
if(frz) {
|
|
14854
|
-
$(r2).show();
|
|
14855
|
-
}
|
|
14856
14564
|
}
|
|
14857
14565
|
} else if(!isNaN(footLevel) && footLevel >=0 && footLevel === num) {
|
|
14858
14566
|
$(r).show();
|
|
14859
|
-
if(frz) {
|
|
14860
|
-
$(r2).show();
|
|
14861
|
-
}
|
|
14862
14567
|
}
|
|
14863
14568
|
r = r.nextSibling;
|
|
14864
|
-
if(frz) {
|
|
14865
|
-
r2 = r2.nextSibling;
|
|
14866
|
-
}
|
|
14867
14569
|
}
|
|
14868
14570
|
}
|
|
14869
14571
|
tarspan.removeClass(plus).addClass(minus);
|
|
14870
14572
|
}
|
|
14871
|
-
if(frz && $t.p.height === 'auto'){
|
|
14872
|
-
$t.grid.fbDiv.height($($t).height());
|
|
14873
|
-
if($t.grid.fsDiv) {
|
|
14874
|
-
var hasscroll = $($t.grid.bDiv)[0].scrollWidth > $($t.grid.bDiv)[0].clientWidth,
|
|
14875
|
-
//scrollbar height
|
|
14876
|
-
scrollh = hasscroll ? $.jgrid.scrollbarHeight() : 0;
|
|
14877
|
-
$t.grid.fsDiv.css('top', ($t.grid.fbDiv.position().top + $($t).height()) + scrollh + 'px');
|
|
14878
|
-
}
|
|
14879
|
-
}
|
|
14880
14573
|
$($t).triggerHandler("jqGridGroupingClickGroup", [hid , collapsed]);
|
|
14881
14574
|
if( $.jgrid.isFunction($t.p.onClickGroup)) { $t.p.onClickGroup.call($t, hid , collapsed); }
|
|
14882
14575
|
|
|
@@ -14886,7 +14579,7 @@ $.jgrid.extend({
|
|
|
14886
14579
|
groupingRender : function (grdata, colspans, page, rn ) {
|
|
14887
14580
|
return this.each(function(){
|
|
14888
14581
|
var $t = this,
|
|
14889
|
-
grp = $t.p.groupingView,
|
|
14582
|
+
grp = $t.p.groupingView, crn = $t.p.rownumbers && grp.groupRowNumbers,
|
|
14890
14583
|
str = "", icon = "", hid, clid, pmrtl = grp.groupCollapse ? grp.plusicon : grp.minusicon, gv, cp=[], len =grp.groupField.length,
|
|
14891
14584
|
//classes = $.jgrid.styleUI[($t.p.styleUI || 'jQueryUI')]['grouping'],
|
|
14892
14585
|
common = $.jgrid.styleUI[($t.p.styleUI || 'jQueryUI')].common;
|
|
@@ -14924,7 +14617,7 @@ $.jgrid.extend({
|
|
|
14924
14617
|
function buildSummaryTd(i, ik, grp, foffset, fstr) {
|
|
14925
14618
|
var fdata = findGroupIdx(i, ik, grp),
|
|
14926
14619
|
cm = $t.p.colModel,
|
|
14927
|
-
vv,
|
|
14620
|
+
vv, str="", k , isput = false, tmpdata, tplfld;
|
|
14928
14621
|
for(k=foffset; k<colspans;k++) {
|
|
14929
14622
|
if(cm[k].hidden ) {
|
|
14930
14623
|
tmpdata = "<td role=\"gridcell\" "+$t.formatCol(k,1,'')+"> </td>";
|
|
@@ -14958,7 +14651,10 @@ $.jgrid.extend({
|
|
|
14958
14651
|
}
|
|
14959
14652
|
var sumreverse = $.makeArray(grp.groupSummary), mul;
|
|
14960
14653
|
sumreverse.reverse();
|
|
14961
|
-
mul = $t.p.multiselect ? " colspan=\"2\"" : "";
|
|
14654
|
+
mul = $t.p.multiselect || $t.p.rownumbers ? " colspan=\"2\"" : "";
|
|
14655
|
+
if($t.p.multiselect && $t.p.rownumbers) {
|
|
14656
|
+
mul = " colspan=\"3\"";
|
|
14657
|
+
}
|
|
14962
14658
|
$.each(grp.groups,function(i,n){
|
|
14963
14659
|
if(grp._locgr) {
|
|
14964
14660
|
if( !(n.startRow +n.cnt > (page-1)*rn && n.startRow < page*rn)) {
|
|
@@ -15008,10 +14704,10 @@ $.jgrid.extend({
|
|
|
15008
14704
|
}
|
|
15009
14705
|
if(grp.groupSummaryPos[n.idx] === 'header') {
|
|
15010
14706
|
str += "<tr id=\""+hid+"\"" +(grp.groupCollapse && n.idx>0 ? " style=\"display:none;\" " : " ") + "role=\"row\" class= \"" + common.content + " jqgroup ui-row-"+$t.p.direction+" "+clid+"\">";
|
|
15011
|
-
str += buildSummaryTd(i, 0, grp.groups, (mul==="" ? 0 : 1), "<td role=\"gridcell\" style=\"padding-left:"+(n.idx * 12) + "px;"+"\"" + mul +">" + icon+grpTextStr + "</td>" );
|
|
14707
|
+
str += buildSummaryTd(i, 0, grp.groups, (mul==="" ? 0 : 1), "<td role=\"gridcell\" style=\"padding-left:"+(n.idx * 12) + "px;"+"\"" + mul + " "+ $t.formatCol(0,1,'')+">" + icon+grpTextStr + "</td>" );
|
|
15012
14708
|
str += "</tr>";
|
|
15013
14709
|
} else {
|
|
15014
|
-
str += "<tr id=\""+hid+"\"" +(grp.groupCollapse && n.idx>0 ? " style=\"display:none;\" " : " ") + "role=\"row\" class= \"" + common.content + " jqgroup ui-row-"+$t.p.direction+" "+clid+"\"><td style=\"padding-left:"+(n.idx * 12) + "px;"+"\" colspan=\""+(grp.groupColumnShow[n.idx] === false ? colspans-
|
|
14710
|
+
str += "<tr id=\""+hid+"\"" +(grp.groupCollapse && n.idx>0 ? " style=\"display:none;\" " : " ") + "role=\"row\" class= \"" + common.content + " jqgroup ui-row-"+$t.p.direction+" "+clid+"\"><td class=\"for-sticky\" style=\"padding-left:"+(n.idx * 12) + "px;"+"\">" + icon + grpTextStr + "</td><td colspan=\""+(grp.groupColumnShow[n.idx] === false ? colspans-2 : colspans-1)+"\"></td></tr>";
|
|
15015
14711
|
}
|
|
15016
14712
|
var leaf = len-1 === n.idx;
|
|
15017
14713
|
if( leaf ) {
|
|
@@ -15023,8 +14719,17 @@ $.jgrid.extend({
|
|
|
15023
14719
|
sgr = offset;
|
|
15024
14720
|
}
|
|
15025
14721
|
}
|
|
14722
|
+
let rncv = 0;
|
|
15026
14723
|
for(kk=sgr;kk<end;kk++) {
|
|
15027
14724
|
if(!grdata[kk - offset]) { break; }
|
|
14725
|
+
if(crn) { // rownumbers
|
|
14726
|
+
let rncell = $(grdata[kk - offset][1]);
|
|
14727
|
+
if(rncell.attr('aria-describedby') === $t.id+"_rn" ) {
|
|
14728
|
+
rncv++;
|
|
14729
|
+
rncell.attr("title", rncv+'').text(rncv+'');
|
|
14730
|
+
grdata[kk - offset][1] = rncell.prop('outerHTML');
|
|
14731
|
+
}
|
|
14732
|
+
}
|
|
15028
14733
|
str += grdata[kk - offset].join('');
|
|
15029
14734
|
}
|
|
15030
14735
|
if(grp.groupSummaryPos[n.idx] !== 'header') {
|
|
@@ -15399,7 +15104,7 @@ $.jgrid.extend({
|
|
|
15399
15104
|
// The next numberOfColumns headers will be moved in the next row
|
|
15400
15105
|
// in the current row will be placed the new column header with the titleText.
|
|
15401
15106
|
// The text will be over the cVisibleColumns columns
|
|
15402
|
-
$colHeader = $('<th>').attr({role: "columnheader"})
|
|
15107
|
+
$colHeader = $('<th>').attr({role: "columnheader", "data-spname": cmi.name})
|
|
15403
15108
|
.addClass(base.headerBox+ " ui-th-column-header ui-th-"+ts.p.direction+" "+className + " "+(cmi.labelClasses || ""))
|
|
15404
15109
|
//.css({'height':'22px', 'border-top': '0 none'})
|
|
15405
15110
|
.html(titleText);
|
|
@@ -15431,6 +15136,7 @@ $.jgrid.extend({
|
|
|
15431
15136
|
$('<th>', {role: "columnheader"})
|
|
15432
15137
|
.addClass(base.headerBox+" ui-th-column-header ui-th-"+ts.p.direction)
|
|
15433
15138
|
.css({"display": cmi.hidden ? 'none' : ''})
|
|
15139
|
+
.attr( { "data-spname": cmi.name})
|
|
15434
15140
|
.insertBefore($th);
|
|
15435
15141
|
$tr.append(th);
|
|
15436
15142
|
}
|
|
@@ -17625,7 +17331,8 @@ $.jgrid.extend({
|
|
|
17625
17331
|
colTotals : false,
|
|
17626
17332
|
groupSummary : true,
|
|
17627
17333
|
groupSummaryPos : 'header',
|
|
17628
|
-
frozenStaticCols : false
|
|
17334
|
+
frozenStaticCols : false,
|
|
17335
|
+
xMeta : []
|
|
17629
17336
|
}, options || {});
|
|
17630
17337
|
this.each(function(){
|
|
17631
17338
|
|
|
@@ -17785,16 +17492,24 @@ $.jgrid.extend({
|
|
|
17785
17492
|
if(xlen === 0 || aggrlen === 0) {
|
|
17786
17493
|
throw("xDimension or aggregates optiona are not set!");
|
|
17787
17494
|
}
|
|
17788
|
-
var colc;
|
|
17495
|
+
var colc, groupfields=[], j=0;
|
|
17789
17496
|
for(i = 0; i< xlen; i++) {
|
|
17497
|
+
if(!o.xDimension[i].hasOwnProperty('dataName')) {
|
|
17498
|
+
j++;
|
|
17499
|
+
continue;
|
|
17500
|
+
}
|
|
17790
17501
|
colc = {name:o.xDimension[i].dataName, frozen: o.frozenStaticCols};
|
|
17791
17502
|
if(o.xDimension[i].isGroupField == null) {
|
|
17792
17503
|
o.xDimension[i].isGroupField = true;
|
|
17793
17504
|
}
|
|
17505
|
+
if(o.xDimension[i].isGroupField) {
|
|
17506
|
+
groupfields.push(o.xDimension[i].dataName);
|
|
17507
|
+
}
|
|
17794
17508
|
colc = $.extend(true, colc, o.xDimension[i]);
|
|
17795
17509
|
columns.push( colc );
|
|
17796
17510
|
}
|
|
17797
|
-
|
|
17511
|
+
xlen -= j;
|
|
17512
|
+
var tree={}, _avg=[], grouplen = groupfields.length, xname;
|
|
17798
17513
|
//tree = { text: 'root', leaf: false, children: [] };
|
|
17799
17514
|
//loop over alll the source data
|
|
17800
17515
|
while( r < rowlen ) {
|
|
@@ -17804,11 +17519,13 @@ $.jgrid.extend({
|
|
|
17804
17519
|
tmp = {};
|
|
17805
17520
|
i = 0;
|
|
17806
17521
|
// build the data from xDimension
|
|
17807
|
-
|
|
17808
|
-
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
|
|
17522
|
+
for(i = 0; i< columns.length; i++) {
|
|
17523
|
+
xname = columns[i].name;
|
|
17524
|
+
if(row.hasOwnProperty(xname)) {
|
|
17525
|
+
xValue.push( $.jgrid.trim(row[xname]) );
|
|
17526
|
+
tmp[xname] = $.jgrid.trim(row[xname]);
|
|
17527
|
+
}
|
|
17528
|
+
}
|
|
17812
17529
|
|
|
17813
17530
|
var k = 0;
|
|
17814
17531
|
rowindex = -1;
|
|
@@ -17839,6 +17556,12 @@ $.jgrid.extend({
|
|
|
17839
17556
|
tmp = agregateFunc( row, o.aggregates, null, tmp );
|
|
17840
17557
|
}
|
|
17841
17558
|
// add the result in pivot rows
|
|
17559
|
+
for(i=0; i < o.xMeta.length; i++) {
|
|
17560
|
+
var meta = o.xMeta[i];
|
|
17561
|
+
if( Object.hasOwn(meta, "dataName") && Object.hasOwn(row, meta.dataName) ) {
|
|
17562
|
+
tmp[meta.dataName] = row[meta.dataName] + "";
|
|
17563
|
+
}
|
|
17564
|
+
}
|
|
17842
17565
|
pivotrows.push( tmp );
|
|
17843
17566
|
} else {
|
|
17844
17567
|
// the pivot exists
|
|
@@ -17861,6 +17584,13 @@ $.jgrid.extend({
|
|
|
17861
17584
|
newObj = agregateFunc( row, o.aggregates, null, newObj );
|
|
17862
17585
|
}
|
|
17863
17586
|
// update the row
|
|
17587
|
+
for(i=0; i < o.xMeta.length; i++) {
|
|
17588
|
+
var meta = o.xMeta[i];
|
|
17589
|
+
if( Object.hasOwn(meta, "dataName") && Object.hasOwn(row, meta.dataName) ) {
|
|
17590
|
+
var sep = Object.hasOwn(meta, "separator") ? meta.separator : ", ";
|
|
17591
|
+
newObj[meta.dataName] += sep + row[meta.dataName];
|
|
17592
|
+
}
|
|
17593
|
+
}
|
|
17864
17594
|
pivotrows[rowindex] = newObj;
|
|
17865
17595
|
}
|
|
17866
17596
|
}
|
|
@@ -18026,19 +17756,17 @@ $.jgrid.extend({
|
|
|
18026
17756
|
}
|
|
18027
17757
|
}
|
|
18028
17758
|
// based on xDimension levels build grouping
|
|
18029
|
-
if(
|
|
18030
|
-
for(i=0;i<
|
|
18031
|
-
|
|
18032
|
-
groupOptions.groupingView.groupField.push(columns[i].name);
|
|
17759
|
+
if( grouplen > 0) {
|
|
17760
|
+
for(i=0;i < grouplen; i++) {
|
|
17761
|
+
groupOptions.groupingView.groupField.push(groupfields[i]);
|
|
18033
17762
|
groupOptions.groupingView.groupSummary.push(o.groupSummary);
|
|
18034
17763
|
groupOptions.groupingView.groupSummaryPos.push(o.groupSummaryPos);
|
|
18035
|
-
}
|
|
18036
17764
|
}
|
|
17765
|
+
groupOptions.sortname = groupfields[i]; //columns[groupfields].name;
|
|
18037
17766
|
} else {
|
|
18038
17767
|
// no grouping is needed
|
|
18039
17768
|
groupOptions.grouping = false;
|
|
18040
17769
|
}
|
|
18041
|
-
groupOptions.sortname = columns[groupfields].name;
|
|
18042
17770
|
groupOptions.groupingView.hideFirstGroupCol = true;
|
|
18043
17771
|
});
|
|
18044
17772
|
// return the final result.
|
|
@@ -18093,8 +17821,8 @@ $.jgrid.extend({
|
|
|
18093
17821
|
}
|
|
18094
17822
|
}
|
|
18095
17823
|
jQuery($t).jqGrid($.extend(true, {
|
|
18096
|
-
|
|
18097
|
-
datatype:
|
|
17824
|
+
data: $.extend(query.select(),footerrow ? {userdata:pivotGrid.summary} : {}),
|
|
17825
|
+
datatype: 'local',
|
|
18098
17826
|
footerrow : footerrow,
|
|
18099
17827
|
userDataOnFooter: footerrow,
|
|
18100
17828
|
colModel: pivotGrid.colModel,
|
|
@@ -18348,7 +18076,7 @@ addSubGrid : function( pos, sind ) {
|
|
|
18348
18076
|
var tr = $(this).parent("tr")[0];
|
|
18349
18077
|
pID = ts.p.id;
|
|
18350
18078
|
_id = tr.id;
|
|
18351
|
-
$r = $("#" + pID + "_" + _id + "_expandedContent");
|
|
18079
|
+
$r = $("#" + $.jgrid.jqID( pID + "_" + _id + "_expandedContent" ) );
|
|
18352
18080
|
if($(this).hasClass("sgcollapsed")) {
|
|
18353
18081
|
bfsc = $(ts).triggerHandler("jqGridSubGridBeforeExpand", [pID + "_" + _id, _id]);
|
|
18354
18082
|
bfsc = (bfsc === false || bfsc === 'stop') ? false : true;
|
|
@@ -20489,21 +20217,27 @@ $.jgrid = $.jgrid || {};
|
|
|
20489
20217
|
|
|
20490
20218
|
|
|
20491
20219
|
$.extend($.jgrid,{
|
|
20492
|
-
formatCell : function ( cellval , colpos, rwdat, cm, $t, etype){
|
|
20493
|
-
var v;
|
|
20220
|
+
formatCell : function ( cellval , colpos, rwdat, cm, $t, etype, adf, acf){
|
|
20221
|
+
var v = cellval;
|
|
20222
|
+
if( adf === undefined ) {
|
|
20223
|
+
adf = true;
|
|
20224
|
+
}
|
|
20225
|
+
if( acf === undefined ) {
|
|
20226
|
+
acf = true;
|
|
20227
|
+
}
|
|
20494
20228
|
if(cm.formatter !== undefined) {
|
|
20495
20229
|
var opts= {rowId: '', colModel:cm, gid: $t.p.id, pos:colpos, styleUI: '', isExported : true, exporttype : etype };
|
|
20496
20230
|
if($.jgrid.isFunction( cm.formatter ) ) {
|
|
20231
|
+
if(acf) {
|
|
20497
20232
|
v = cm.formatter.call($t,cellval,opts,rwdat);
|
|
20233
|
+
}
|
|
20498
20234
|
} else if($.fmatter){
|
|
20235
|
+
if(adf) {
|
|
20499
20236
|
v = $.fn.fmatter.call($t,cm.formatter,cellval,opts,rwdat);
|
|
20500
|
-
} else {
|
|
20501
|
-
v = cellval;
|
|
20502
20237
|
}
|
|
20503
|
-
} else {
|
|
20504
|
-
v = cellval;
|
|
20505
20238
|
}
|
|
20506
|
-
|
|
20239
|
+
}
|
|
20240
|
+
return v == null ? '' : v;
|
|
20507
20241
|
},
|
|
20508
20242
|
formatCellCsv : function (v, p) {
|
|
20509
20243
|
v = v == null ? '' : String(v);
|
|
@@ -20553,6 +20287,11 @@ $.extend($.jgrid,{
|
|
|
20553
20287
|
}
|
|
20554
20288
|
return currNode;
|
|
20555
20289
|
},
|
|
20290
|
+
xmlToString : function (xmlDom) {
|
|
20291
|
+
return (typeof XMLSerializer!=="undefined") ?
|
|
20292
|
+
(new window.XMLSerializer()).serializeToString(xmlDom) :
|
|
20293
|
+
xmlDom.xml;
|
|
20294
|
+
},
|
|
20556
20295
|
xmlToZip : function ( zip, obj ) {
|
|
20557
20296
|
var $t = this,
|
|
20558
20297
|
xmlserialiser = new XMLSerializer(),
|
|
@@ -20875,6 +20614,12 @@ $.extend($.jgrid,{
|
|
|
20875
20614
|
if( $.isEmptyObject( obj )) {
|
|
20876
20615
|
obj.excel_parsers = true;
|
|
20877
20616
|
}
|
|
20617
|
+
var checkSt = true;
|
|
20618
|
+
if(styleSh == null) {
|
|
20619
|
+
var es= $.jgrid.excelStrings;
|
|
20620
|
+
styleSh = $.parseXML( es['xl/styles.xml']);
|
|
20621
|
+
checkSt = false;
|
|
20622
|
+
}
|
|
20878
20623
|
//var styleSh = $.parseXML( $.jgrid.excelStrings['xl/styles.xml']), //xlsx.xl["styles.xml"];
|
|
20879
20624
|
var formats = styleSh.getElementsByTagName("numFmts")[0],
|
|
20880
20625
|
celsX = styleSh.getElementsByTagName("cellXfs")[0];
|
|
@@ -20922,14 +20667,18 @@ $.extend($.jgrid,{
|
|
|
20922
20667
|
celsX.appendChild( mycell );
|
|
20923
20668
|
count = $('cellXfs xf', styleSh).length;
|
|
20924
20669
|
$(celsX).attr("count", count);
|
|
20925
|
-
obj[style] = count
|
|
20670
|
+
obj[style] = count-1;
|
|
20671
|
+
if(!checkSt) {
|
|
20672
|
+
es['xl/styles.xml'] = $.jgrid.xmlToString( styleSh );
|
|
20673
|
+
}
|
|
20926
20674
|
}
|
|
20927
20675
|
return obj;
|
|
20928
20676
|
},
|
|
20929
20677
|
newExcelStyle : function ( xlsx, options ) {
|
|
20930
20678
|
options = $.extend(true, {
|
|
20931
20679
|
font : { size : 11, name : 'Calibri', options :""}, // options <b/> <i/> <u/>
|
|
20932
|
-
color : { patternType : "solid", fgColor : "FFFFFFF", bgColor : 64 } // bgColor if number 0-64
|
|
20680
|
+
color : { patternType : "solid", fgColor : "FFFFFFF", bgColor : 64 }, // bgColor if number 0-64
|
|
20681
|
+
border : 0 //{leftStyle : 'none', rightStyle:'none', topStyle : 'none', bottomStyle : none, color : 'auto'}
|
|
20933
20682
|
}, options || {});
|
|
20934
20683
|
//PatterType can be one of the following
|
|
20935
20684
|
/*
|
|
@@ -20937,6 +20686,14 @@ $.extend($.jgrid,{
|
|
|
20937
20686
|
darkUp,darkVertical,gray0625,gray125,lightDown,lightGray,lightGrid
|
|
20938
20687
|
lightHorizontal,lightTrellis,lightUp,lightVertical,mediumGray
|
|
20939
20688
|
*/
|
|
20689
|
+
// border style values can be
|
|
20690
|
+
/*
|
|
20691
|
+
dashDot, dashDotDot, dashed, dotted, double, hair, medium, mediumDashDot,
|
|
20692
|
+
mediumDashDotDot, mediumDashed, none, slantDashDot, thick, thin
|
|
20693
|
+
*/
|
|
20694
|
+
/* color can be
|
|
20695
|
+
auto or string representing rgb value or number from 0-64
|
|
20696
|
+
*/
|
|
20940
20697
|
//styleSheet.childNodes[0].childNodes[0] ==> number formats <numFmts count="6"> </numFmts>
|
|
20941
20698
|
//styleSheet.childNodes[0].childNodes[1] ==> fonts <fonts count="5" x14ac:knownFonts="1"> </fonts>
|
|
20942
20699
|
//styleSheet.childNodes[0].childNodes[2] ==> fills <fills count="6"> </fills>
|
|
@@ -20945,10 +20702,11 @@ $.extend($.jgrid,{
|
|
|
20945
20702
|
//styleSheet.childNodes[0].childNodes[5] ==> cell xfs <cellXfs count="69"> </cellXfs>
|
|
20946
20703
|
//on the last line we have the 69 currently built in styles (0 - 68)
|
|
20947
20704
|
|
|
20948
|
-
var sSh = xlsx.xl['styles.xml']
|
|
20949
|
-
|
|
20950
|
-
|
|
20951
|
-
|
|
20705
|
+
var sSh = xlsx.xl['styles.xml'],
|
|
20706
|
+
lastXfIndex = $('cellXfs xf', sSh).length - 1,
|
|
20707
|
+
lastFontIndex = $('fonts font', sSh).length - 1,
|
|
20708
|
+
lastFillIndex = $('fills fill', sSh).length - 1,
|
|
20709
|
+
lastBorderIndex = $('borders border', sSh).length - 1;
|
|
20952
20710
|
|
|
20953
20711
|
|
|
20954
20712
|
var font1 =
|
|
@@ -20958,9 +20716,9 @@ $.extend($.jgrid,{
|
|
|
20958
20716
|
options.font.options +
|
|
20959
20717
|
'</font>';
|
|
20960
20718
|
sSh.childNodes[0].childNodes[1].innerHTML += font1; //new font
|
|
20961
|
-
var bgcolor = '
|
|
20719
|
+
var bgcolor = 'rgb =';
|
|
20962
20720
|
if(parseInt(options.color.bgColor,10) >= 0 ) {
|
|
20963
|
-
bgcolor = '
|
|
20721
|
+
bgcolor = 'indexed =';
|
|
20964
20722
|
}
|
|
20965
20723
|
bgcolor += '"'+options.color.bgColor+'"';
|
|
20966
20724
|
var color1 =
|
|
@@ -20971,7 +20729,37 @@ $.extend($.jgrid,{
|
|
|
20971
20729
|
'</patternFill>'+
|
|
20972
20730
|
'</fill>';
|
|
20973
20731
|
sSh.childNodes[0].childNodes[2].innerHTML += color1; //new color
|
|
20974
|
-
|
|
20732
|
+
if($.isPlainObject(options.border)) {
|
|
20733
|
+
options.border = $.extend({leftStyle : 'none', rightStyle:'none', topStyle : 'none', bottomStyle : 'none', color : 'auto'}, options.border || {})
|
|
20734
|
+
var bcolor;
|
|
20735
|
+
if(options.border.color === 'auto') {
|
|
20736
|
+
bcolor = 'auto="1"';
|
|
20737
|
+
} else if( $.fmatter.isNumber(options.border.color) ) {
|
|
20738
|
+
bcolor = 'indexed="'+options.border.color+'"';
|
|
20739
|
+
} else if($.fmatter.isString(options.border.color)) {
|
|
20740
|
+
bcolor = 'rgb="'+options.border.color+'"';
|
|
20741
|
+
}
|
|
20742
|
+
var border1 =
|
|
20743
|
+
'<border diagonalUp="false" diagonalDown="false">'+
|
|
20744
|
+
'<left style="'+options.border.leftStyle+'">' +
|
|
20745
|
+
'<color '+bcolor+' />'+
|
|
20746
|
+
'</left>'+
|
|
20747
|
+
'<right style="'+options.border.rightStyle+'">' +
|
|
20748
|
+
'<color '+bcolor+' />'+
|
|
20749
|
+
'</right>'+
|
|
20750
|
+
'<top style="'+options.border.topStyle+'">' +
|
|
20751
|
+
'<color '+bcolor+' />'+
|
|
20752
|
+
'</top>'+
|
|
20753
|
+
'<bottom style="'+options.border.bottomStyle+'">' +
|
|
20754
|
+
'<color '+bcolor+' />'+
|
|
20755
|
+
'</bottom>'+
|
|
20756
|
+
'<diagonal />'+
|
|
20757
|
+
'</border>';
|
|
20758
|
+
sSh.childNodes[0].childNodes[3].innerHTML += border1; //new border
|
|
20759
|
+
} else {
|
|
20760
|
+
lastBorderIndex = parseInt(options.border,10)-1;
|
|
20761
|
+
}
|
|
20762
|
+
var s1 = '<xf numFmtId="0" fontId="'+(lastFontIndex+1)+'" fillId="'+(lastFillIndex+1)+'" borderId="'+(lastBorderIndex+1)+'" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"></xf>';
|
|
20975
20763
|
sSh.childNodes[0].childNodes[5].innerHTML += s1;
|
|
20976
20764
|
return (lastXfIndex + 1);
|
|
20977
20765
|
}
|
|
@@ -21002,7 +20790,9 @@ $.jgrid.extend({
|
|
|
21002
20790
|
onBeforeExport : null,
|
|
21003
20791
|
treeindent : ' ',
|
|
21004
20792
|
visibleTreeNodes : false,
|
|
21005
|
-
loadIndicator : true // can be a function
|
|
20793
|
+
loadIndicator : true, // can be a function
|
|
20794
|
+
applyDefFmt : true,
|
|
20795
|
+
applyCustFmt : true
|
|
21006
20796
|
}, p || {});
|
|
21007
20797
|
var ret ="";
|
|
21008
20798
|
this.each(function(){
|
|
@@ -21145,7 +20935,7 @@ $.jgrid.extend({
|
|
|
21145
20935
|
for(ik = 0; ik < cm.length; ik++) {
|
|
21146
20936
|
if(cm[ik]._expcol) {
|
|
21147
20937
|
arr[k] = $.jgrid.formatCellCsv(
|
|
21148
|
-
$.jgrid.formatCell( $.jgrid.getAccessor(to, cm[ik].name), ik, to, cm[ik], $t, 'csv' ) , p);
|
|
20938
|
+
$.jgrid.formatCell( $.jgrid.getAccessor(to, cm[ik].name), ik, to, cm[ik], $t, 'csv', p.applyDefFmt, p.applyCustFmt ) , p);
|
|
21149
20939
|
k++;
|
|
21150
20940
|
}
|
|
21151
20941
|
}
|
|
@@ -21217,7 +21007,7 @@ $.jgrid.extend({
|
|
|
21217
21007
|
k =0;
|
|
21218
21008
|
for(i = 0; i < cmlen; i++) {
|
|
21219
21009
|
if(cm[i]._expcol) {
|
|
21220
|
-
tmp[k] = $.jgrid.formatCellCsv( $.jgrid.formatCell( $.jgrid.getAccessor(row, cm[i].name) , i, row, cm[i], $t, 'csv' ), p );
|
|
21010
|
+
tmp[k] = $.jgrid.formatCellCsv( $.jgrid.formatCell( $.jgrid.getAccessor(row, cm[i].name) , i, row, cm[i], $t, 'csv', p.applyDefFmt, p.applyCustFmt ), p );
|
|
21221
21011
|
k++;
|
|
21222
21012
|
}
|
|
21223
21013
|
}
|
|
@@ -21332,7 +21122,9 @@ $.jgrid.extend({
|
|
|
21332
21122
|
replaceStr : null,
|
|
21333
21123
|
treeindent : ' ',
|
|
21334
21124
|
visibleTreeNodes : false,
|
|
21335
|
-
loadIndicator : true // can be a function
|
|
21125
|
+
loadIndicator : true, // can be a function
|
|
21126
|
+
applyDefFmt : true,
|
|
21127
|
+
applyCustFmt : true
|
|
21336
21128
|
}, o || {} );
|
|
21337
21129
|
this.each(function() {
|
|
21338
21130
|
var $t = this,
|
|
@@ -21511,7 +21303,7 @@ $.jgrid.extend({
|
|
|
21511
21303
|
}
|
|
21512
21304
|
if(!header) {
|
|
21513
21305
|
omit = (i===0 && skipfirstcol);
|
|
21514
|
-
v = omit || (skipfirstcol && v==='') ? v : $.jgrid.formatCell( v, data.map[i], row, cm[data.map[i]], $t, 'excel');
|
|
21306
|
+
v = omit || (skipfirstcol && v==='') ? v : $.jgrid.formatCell( v, data.map[i], row, cm[data.map[i]], $t, 'excel', o.applyDefFmt, o.applyCustFmt);
|
|
21515
21307
|
// convert whitespace from formatter to empty string
|
|
21516
21308
|
if(v && (v===' ' || v===' ' || (v.length===1 && v.charCodeAt(0)===160))) {
|
|
21517
21309
|
v = '';
|
|
@@ -21566,7 +21358,7 @@ $.jgrid.extend({
|
|
|
21566
21358
|
break;
|
|
21567
21359
|
}
|
|
21568
21360
|
}
|
|
21569
|
-
cell = _makeCellSpecial( {r: cellId,s: special.style}, v );
|
|
21361
|
+
cell = _makeCellSpecial( { r: cellId,s: special.style}, v );
|
|
21570
21362
|
}
|
|
21571
21363
|
rowNode.appendChild( cell );
|
|
21572
21364
|
break;
|
|
@@ -21987,7 +21779,9 @@ $.jgrid.extend({
|
|
|
21987
21779
|
treeindent : "-",
|
|
21988
21780
|
visibleTreeNodes : false,
|
|
21989
21781
|
centerTableOnPage : false,
|
|
21990
|
-
loadIndicator : true // can be a function
|
|
21782
|
+
loadIndicator : true, // can be a function
|
|
21783
|
+
applyDefFmt : true,
|
|
21784
|
+
applyCustFmt : true
|
|
21991
21785
|
|
|
21992
21786
|
}, o || {} );
|
|
21993
21787
|
return this.each(function() {
|
|
@@ -22021,7 +21815,7 @@ $.jgrid.extend({
|
|
|
22021
21815
|
ommit = !(key === 0 && skipfirstcol);// ? false : true;
|
|
22022
21816
|
val = row[def[key]];
|
|
22023
21817
|
obj = {
|
|
22024
|
-
text:
|
|
21818
|
+
text: fmt && ommit ? $.jgrid.formatCell( val + '', map[k], data[i], cm[map[k]], $t, 'pdf', o.applyDefFmt, o.applyCustFmt) : val,
|
|
22025
21819
|
alignment : align[key],
|
|
22026
21820
|
style : 'tableBody'
|
|
22027
21821
|
};
|
|
@@ -22299,7 +22093,7 @@ $.jgrid.extend({
|
|
|
22299
22093
|
row = data[i];
|
|
22300
22094
|
for( key = 0;key < def.length; key++ ) {
|
|
22301
22095
|
obj = {
|
|
22302
|
-
text:
|
|
22096
|
+
text: $.jgrid.stripHtml($.jgrid.formatCell( $.jgrid.getAccessor(row, def[key]) + '', map[k], data[i], cm[map[k]], $t, 'pdf', o.applyDefFmt, o.applyCustFmt)),
|
|
22303
22097
|
alignment : align[def[key]],
|
|
22304
22098
|
style : 'tableBody'
|
|
22305
22099
|
};
|
|
@@ -22438,7 +22232,9 @@ $.jgrid.extend({
|
|
|
22438
22232
|
returnAsString : false,
|
|
22439
22233
|
treeindent : ' ',
|
|
22440
22234
|
visibleTreeNodes : false,
|
|
22441
|
-
loadIndicator : true // can be a function
|
|
22235
|
+
loadIndicator : true, // can be a function
|
|
22236
|
+
applyDefFmt : true,
|
|
22237
|
+
applyCustFmt : true
|
|
22442
22238
|
}, o || {} );
|
|
22443
22239
|
var ret;
|
|
22444
22240
|
this.each(function() {
|
|
@@ -22520,7 +22316,7 @@ $.jgrid.extend({
|
|
|
22520
22316
|
}
|
|
22521
22317
|
f= data.header[i];
|
|
22522
22318
|
if (d.hasOwnProperty(f) ) {
|
|
22523
|
-
str += '<'+tag+stl+'>'+ (frm ? $.jgrid.formatCell( $.jgrid.getAccessor( d, f ), data.map[i], d, cm[data.map[i]], $t, 'html') : d[f])+'</'+tag+'>';
|
|
22319
|
+
str += '<'+tag+stl+'>'+ (frm ? $.jgrid.formatCell( $.jgrid.getAccessor( d, f ), data.map[i], d, cm[data.map[i]], $t, 'html', o.applyDefFmt, o.applyCustFmt) : d[f])+'</'+tag+'>';
|
|
22524
22320
|
}
|
|
22525
22321
|
if(colsp) {
|
|
22526
22322
|
break;
|
|
@@ -23799,202 +23595,81 @@ $.jgrid.extend({
|
|
|
23799
23595
|
first : 0,
|
|
23800
23596
|
last : 0,
|
|
23801
23597
|
rowids :[],
|
|
23802
|
-
saveFirstLastId : false,
|
|
23803
|
-
classes : ""
|
|
23598
|
+
//saveFirstLastId : false,
|
|
23599
|
+
classes : "frozen-row-class"
|
|
23804
23600
|
}, options || {});
|
|
23805
23601
|
|
|
23806
23602
|
return this.each(function(){
|
|
23807
23603
|
// restrictions
|
|
23808
23604
|
if(this.p.subGrid === true ||
|
|
23809
23605
|
this.p.treeGrid === true ||
|
|
23810
|
-
this.p.cellEdit === true ||
|
|
23811
|
-
|
|
23606
|
+
//this.p.cellEdit === true ||
|
|
23607
|
+
// $t.p.sortable ||
|
|
23812
23608
|
this.p.scroll ||
|
|
23813
|
-
this.p.frozenColumns === true ||
|
|
23814
|
-
this.p.frozenRows === true||
|
|
23609
|
+
//this.p.frozenColumns === true ||
|
|
23610
|
+
//this.p.frozenRows === true||
|
|
23815
23611
|
this.p.grouping === true)
|
|
23816
23612
|
{
|
|
23817
23613
|
return;
|
|
23818
23614
|
}
|
|
23819
|
-
|
|
23820
|
-
return;
|
|
23821
|
-
}
|
|
23822
|
-
|
|
23823
|
-
|
|
23824
|
-
var $t = this, i, j, len,
|
|
23825
|
-
borderbox = $("#"+$.jgrid.jqID($t.p.id)).css("box-sizing") === 'border-box',
|
|
23826
|
-
pixelfix = borderbox ? 1 : 0,
|
|
23827
|
-
tid = '#'+$.jgrid.jqID($t.p.id),
|
|
23828
|
-
tvid ='#gview_'+$.jgrid.jqID($t.p.id),
|
|
23829
|
-
//hth = $(".ui-jqgrid-htable", tvid).height(),//Get the height of the column header to set the top value
|
|
23830
|
-
hgh = document.getElementById("gbox_"+$t.p.id).getBoundingClientRect().top,
|
|
23831
|
-
hth = document.getElementById($t.p.id).getBoundingClientRect().top,
|
|
23832
|
-
htw = $(tvid).width(),//Get the width of the content
|
|
23833
|
-
frowms = [],//store frozen rows
|
|
23834
|
-
fbDiv = $('<div style="position:absolute;left:0px;top:'+(hth-hgh-pixelfix)+'px;height:0px;overflow-x:hidden;" class="frozen-rdiv ui-jqgrid-rdiv"></div>');
|
|
23835
|
-
|
|
23836
|
-
$(tvid).append(fbDiv);
|
|
23837
|
-
$('.frozen-rdiv', tvid).css('width',htw-($.jgrid.scrollbarWidth()+2));
|
|
23838
|
-
frowms.push($('.jqgfirstrow', tid).clone(true));
|
|
23839
|
-
|
|
23615
|
+
var $t = this, row, pos =0, len =0;
|
|
23840
23616
|
if(prm.rowids && prm.rowids.length > 0 ) {
|
|
23841
|
-
for( i =0;i<prm.rowids.length; i++ ) {
|
|
23842
|
-
j = $t.rows.length;
|
|
23617
|
+
for( let i =0;i<prm.rowids.length; i++ ) {
|
|
23618
|
+
let j = $t.rows.length;
|
|
23843
23619
|
while( j-- ) {
|
|
23844
|
-
if($t.rows[j].id === prm.rowids[i]) {
|
|
23845
|
-
frowms.push($($t.rows[j]).clone(true));
|
|
23620
|
+
if($t.rows[j].id === prm.rowids[i]+"") {
|
|
23846
23621
|
$($t.rows[j]).insertBefore($t.rows[i+1]);
|
|
23847
23622
|
break;
|
|
23848
23623
|
}
|
|
23849
23624
|
}
|
|
23850
23625
|
}
|
|
23626
|
+
len = prm.rowids.length;
|
|
23851
23627
|
} else if(prm.first > 0) {
|
|
23852
|
-
|
|
23853
|
-
|
|
23854
|
-
|
|
23855
|
-
|
|
23856
|
-
|
|
23857
|
-
}
|
|
23858
|
-
prm.rowids.push($t.rows[i+1].id);
|
|
23859
|
-
}
|
|
23860
|
-
}
|
|
23861
|
-
} else if(prm.last > 0) {
|
|
23862
|
-
j = $t.rows.length;
|
|
23863
|
-
for(i = 0; i < prm.last; i++) {
|
|
23864
|
-
frowms.splice(1,0,$($t.rows[j-1]).clone(true));
|
|
23865
|
-
if(prm.saveFirstLastId) {
|
|
23866
|
-
if(!prm.rowids) {
|
|
23867
|
-
prm.rowids =[];
|
|
23868
|
-
}
|
|
23869
|
-
prm.rowids.unshift($t.rows[j-1].id);
|
|
23870
|
-
}
|
|
23628
|
+
len = prm.first
|
|
23629
|
+
} else if(prm.last > 0 ) {
|
|
23630
|
+
let j = $t.rows.length;
|
|
23631
|
+
len = prm.last;
|
|
23632
|
+
for(let i=0; i<prm.last; i++) {
|
|
23871
23633
|
$($t.rows[j-1]).insertBefore($t.rows[1]);
|
|
23872
23634
|
}
|
|
23873
23635
|
} else {
|
|
23874
23636
|
return;
|
|
23875
23637
|
}
|
|
23876
|
-
|
|
23877
|
-
|
|
23878
|
-
|
|
23879
|
-
|
|
23880
|
-
|
|
23881
|
-
for(j = 0 ,len = frowms.length; j <len; j++){//Loop insert the cloned row into the <tbody></tbody> tag
|
|
23882
|
-
frowms[j].addClass(prm.classes).appendTo(out);
|
|
23883
|
-
}
|
|
23884
|
-
out.appendTo(fbDiv);
|
|
23885
|
-
var tfid = $t.p.id +"_fr";
|
|
23886
|
-
$(tid, fbDiv).attr("id", tfid);
|
|
23887
|
-
tfid = '#'+$.jgrid.jqID(tfid);
|
|
23888
|
-
|
|
23889
|
-
/*
|
|
23890
|
-
* Set the events required in freezing
|
|
23891
|
-
* */
|
|
23892
|
-
var getstyle = $.jgrid.getMethod("getStyleUI"),
|
|
23893
|
-
stylemodule = $t.p.styleUI + ".common",
|
|
23894
|
-
//disabled = getstyle(stylemodule,'disabled', true),
|
|
23895
|
-
highlight = getstyle(stylemodule,'highlight', true),
|
|
23896
|
-
hover = getstyle(stylemodule,'hover', true);
|
|
23897
|
-
$('.frozen-rdiv', tvid).on('click','tr',function(){//click on the frozen line to add a highlight effect
|
|
23898
|
-
if($t.p.selrow) {
|
|
23899
|
-
$($t).jqGrid('resetSelection',$t.p.selrow);
|
|
23900
|
-
}
|
|
23901
|
-
var index = $(this).index();
|
|
23902
|
-
$(this).addClass(highlight).siblings().removeClass(highlight);
|
|
23903
|
-
$t.p.selrow = this.id;
|
|
23904
|
-
$('.frozen-rdiv tr').eq(index).addClass(highlight).siblings().removeClass(highlight);
|
|
23905
|
-
});
|
|
23906
|
-
$(tfid).on('click',function(){//When the click is a frozen column, the highlighting effect of the frozen column is clear
|
|
23907
|
-
$('.frozen-rdiv tbody').children('tr').each(function(){
|
|
23908
|
-
$(this).removeClass(highlight);
|
|
23909
|
-
});
|
|
23910
|
-
});
|
|
23911
|
-
|
|
23912
|
-
var bdiv = $(tvid +" .ui-jqgrid-bdiv").first();
|
|
23913
|
-
bdiv.on('scroll', function(){//Set the left and right scroll of the frozen line
|
|
23914
|
-
var curX = this.scrollLeft;
|
|
23915
|
-
$('.frozen-rdiv').scrollLeft(curX);
|
|
23916
|
-
});
|
|
23917
|
-
|
|
23918
|
-
$('.frozen-rdiv tr').hover(//Set the effect of moving the mouse on the frozen line
|
|
23919
|
-
function(){
|
|
23920
|
-
var index = $(this).index();
|
|
23921
|
-
$('.frozen-rdiv tr').eq(index).addClass(hover);
|
|
23922
|
-
},
|
|
23923
|
-
function(){
|
|
23924
|
-
var index = $(this).index();
|
|
23925
|
-
$('.frozen-rdiv tr').eq(index).removeClass(hover);
|
|
23638
|
+
for(let i = 0; i < len; i++) {
|
|
23639
|
+
row = $t.rows[i+1];
|
|
23640
|
+
if(row.classList.contains("jqgrow")) {
|
|
23641
|
+
$(row).addClass(prm.classes).css("top", pos + "px");
|
|
23926
23642
|
}
|
|
23927
|
-
|
|
23928
|
-
if($t.p.rownumbers) {
|
|
23929
|
-
var find_index = false;
|
|
23930
|
-
try {
|
|
23931
|
-
$($t.rows[0].cells).each(function(k){
|
|
23932
|
-
if( $(this).hasClass('jqgrid-rownumber')) {
|
|
23933
|
-
find_index = k;
|
|
23934
|
-
return false;
|
|
23935
|
-
}
|
|
23936
|
-
});
|
|
23937
|
-
if(find_index !== false) {
|
|
23938
|
-
j = $t.rows.length;
|
|
23939
|
-
i=1;
|
|
23940
|
-
while (i<j) {
|
|
23941
|
-
$($t.rows[i].cells[find_index]).html( i );
|
|
23942
|
-
i++;
|
|
23943
|
-
}
|
|
23944
|
-
j = $(tfid)[0].rows.length;
|
|
23945
|
-
i=1;
|
|
23946
|
-
while (i<j) {
|
|
23947
|
-
$(tfid)[0].rows[i].cells[find_index].innerHTML = i ;
|
|
23948
|
-
i++;
|
|
23949
|
-
}
|
|
23950
|
-
}
|
|
23951
|
-
} catch(e){}
|
|
23643
|
+
pos += $(row).outerHeight();
|
|
23952
23644
|
}
|
|
23953
|
-
|
|
23954
|
-
$t.grid.frbDiv = fbDiv;
|
|
23955
23645
|
$t.p.frozenRows = true;
|
|
23956
|
-
$t.p.frozenRowsPrm = prm;
|
|
23957
|
-
});
|
|
23958
|
-
},
|
|
23959
|
-
destroyFrozenRows : function(deep) {
|
|
23960
|
-
return this.each(function(){
|
|
23961
|
-
this.grid.frbDiv.remove();
|
|
23962
|
-
this.p.frozenRows = false;
|
|
23963
|
-
if(deep) {
|
|
23964
|
-
this.p.frozenRowsPrm = null;
|
|
23965
|
-
}
|
|
23966
23646
|
});
|
|
23967
23647
|
},
|
|
23968
|
-
setFrozenRows : function(
|
|
23648
|
+
setFrozenRows : function (options ) {
|
|
23969
23649
|
return this.each(function(){
|
|
23970
|
-
|
|
23971
23650
|
if( this.p.records > 0 ) {
|
|
23972
23651
|
$(this).jqGrid("setupFrozenRows", options);
|
|
23973
23652
|
}
|
|
23974
23653
|
|
|
23975
23654
|
$(this).on('jqGridAfterGridComplete.setFrozenRows', function () {
|
|
23976
|
-
|
|
23977
|
-
|
|
23978
|
-
|
|
23979
|
-
|
|
23980
|
-
|
|
23981
|
-
|
|
23982
|
-
|
|
23983
|
-
|
|
23984
|
-
|
|
23985
|
-
|
|
23986
|
-
|
|
23987
|
-
|
|
23988
|
-
|
|
23989
|
-
|
|
23990
|
-
}
|
|
23991
|
-
$(this).jqGrid("setupFrozenRows", this.p.frozenRowsPrm);
|
|
23992
|
-
if(test) {
|
|
23993
|
-
this.p.frozenRowsPrm.first = 0;
|
|
23994
|
-
}
|
|
23995
|
-
} catch(e){}
|
|
23655
|
+
$(this).jqGrid("setupFrozenRows", options);
|
|
23656
|
+
});
|
|
23657
|
+
});
|
|
23658
|
+
},
|
|
23659
|
+
destroyFrozenRows: function(options) {
|
|
23660
|
+
var prm = $.extend({
|
|
23661
|
+
classes : "frozen-row-class",
|
|
23662
|
+
rowsToScan : 5
|
|
23663
|
+
}, options || {});
|
|
23664
|
+
return this.each(function(){
|
|
23665
|
+
var $t = this;
|
|
23666
|
+
for(let i=0; i < prm.rowsToScan; i++) {
|
|
23667
|
+
if($t.rows[i+1] && $t.rows[i+1].classList.contains(prm.classes) ) {
|
|
23668
|
+
$($t.rows[i+1]).removeClass(prm.classes).css("top","");
|
|
23996
23669
|
}
|
|
23997
|
-
}
|
|
23670
|
+
}
|
|
23671
|
+
$(this).off('jqGridAfterGridComplete.setFrozenRows');
|
|
23672
|
+
$t.p.frozenRows = false;
|
|
23998
23673
|
});
|
|
23999
23674
|
}
|
|
24000
23675
|
});
|
|
@@ -24278,4 +23953,575 @@ $.jgrid.extend({
|
|
|
24278
23953
|
}
|
|
24279
23954
|
});
|
|
24280
23955
|
|
|
23956
|
+
//module begin
|
|
23957
|
+
// clipboard
|
|
23958
|
+
$.extend($.jgrid,{
|
|
23959
|
+
deserializeRow : function (row, delimiter = ',') {
|
|
23960
|
+
const values = [];
|
|
23961
|
+
let index = 0, matchStart = 0, isInsideQuotations = false;
|
|
23962
|
+
while (true) {
|
|
23963
|
+
if (index === row.length) {
|
|
23964
|
+
values.push(row.slice(matchStart, index));
|
|
23965
|
+
break;
|
|
23966
|
+
}
|
|
23967
|
+
const char = row[index];
|
|
23968
|
+
if (char === delimiter && !isInsideQuotations) {
|
|
23969
|
+
values.push(
|
|
23970
|
+
row
|
|
23971
|
+
.slice(matchStart, index)
|
|
23972
|
+
.replace(/^"|"$/g, '')
|
|
23973
|
+
.replace(/""/g, '"')
|
|
23974
|
+
.replace(/\\n/g, '\n')
|
|
23975
|
+
);
|
|
23976
|
+
matchStart = index + 1;
|
|
23977
|
+
}
|
|
23978
|
+
if (char === '"')
|
|
23979
|
+
if (row[index + 1] === '"') index += 1;
|
|
23980
|
+
else isInsideQuotations = !isInsideQuotations;
|
|
23981
|
+
index += 1;
|
|
23982
|
+
}
|
|
23983
|
+
return values;
|
|
23984
|
+
},
|
|
23985
|
+
CSVtoObject : function (data, headers, delimiter = ',', new_line = '\t') {
|
|
23986
|
+
const rows = data, /*data.split(new_line),*/ len = rows.length;
|
|
23987
|
+
if(len && rows[len-1] == "") {
|
|
23988
|
+
rows.pop()
|
|
23989
|
+
}
|
|
23990
|
+
return rows.map((row) => {
|
|
23991
|
+
const values = $.jgrid.deserializeRow(row, delimiter);
|
|
23992
|
+
return headers.reduce((obj, key, index) => {
|
|
23993
|
+
obj[key] = values[index];
|
|
23994
|
+
return obj;
|
|
23995
|
+
}, {});
|
|
23996
|
+
});
|
|
23997
|
+
},
|
|
23998
|
+
Permissions : async function() {
|
|
23999
|
+
const queryOpts = { name: 'clipboard-read', allowWithoutGesture: false };
|
|
24000
|
+
navigator.permissions.query(queryOpts).then((permObj)=>{
|
|
24001
|
+
// state will be 'granted', 'denied' or 'prompt':
|
|
24002
|
+
if( permObj && permObj.state === 'denied') {
|
|
24003
|
+
let msg = $.jgrid.getRegional(this, 'clipboard.errors');
|
|
24004
|
+
$.jgrid.toast({
|
|
24005
|
+
text: msg.enb_prm,
|
|
24006
|
+
autoClose : false,
|
|
24007
|
+
styleUI: this.p.styleUI,
|
|
24008
|
+
type:"warning"
|
|
24009
|
+
});
|
|
24010
|
+
}
|
|
24011
|
+
// Listen for changes to the permission state
|
|
24012
|
+
// permissionStatus.onchange = () => {
|
|
24013
|
+
// console.log(permissionStatus.state);
|
|
24014
|
+
// }
|
|
24015
|
+
}).catch((error)=>{
|
|
24016
|
+
// no translation
|
|
24017
|
+
console.log("clipboard-read permission not supported for this browser.")
|
|
24018
|
+
});
|
|
24019
|
+
},
|
|
24020
|
+
copyText: async function (textValue, o) {
|
|
24021
|
+
try {
|
|
24022
|
+
await navigator.clipboard.writeText(textValue);
|
|
24023
|
+
if(o.show_info_after_copy) {
|
|
24024
|
+
let msg = $.jgrid.getRegional(this, 'clipboard.msg');
|
|
24025
|
+
$.jgrid.toast( {
|
|
24026
|
+
text: msg.text_c,
|
|
24027
|
+
styleUI: this.p.styleUI,
|
|
24028
|
+
type:"info",
|
|
24029
|
+
position: o.toastPosition
|
|
24030
|
+
});
|
|
24031
|
+
}
|
|
24032
|
+
} catch (err) {
|
|
24033
|
+
let msg = $.jgrid.getRegional(this, 'clipboard.errors');
|
|
24034
|
+
$.jgrid.toast( {
|
|
24035
|
+
text: msg.copy_err + err,
|
|
24036
|
+
autoCloseTime: 4500,
|
|
24037
|
+
styleUI: this.p.styleUI,
|
|
24038
|
+
type:"error"
|
|
24039
|
+
});
|
|
24040
|
+
}
|
|
24041
|
+
},
|
|
24042
|
+
getClipboardContents : async function ( ) {
|
|
24043
|
+
try {
|
|
24044
|
+
const text = await navigator.clipboard.readText();
|
|
24045
|
+
return text;
|
|
24046
|
+
} catch (err) {
|
|
24047
|
+
let msg = $.jgrid.getRegional(this, 'clipboard.errors');
|
|
24048
|
+
$.jgrid.toast( {
|
|
24049
|
+
text: msg.read_err + err,
|
|
24050
|
+
styleUI: this.p.styleUI,
|
|
24051
|
+
autoCloseTime: 4500,
|
|
24052
|
+
type:"error"
|
|
24053
|
+
});
|
|
24054
|
+
}
|
|
24055
|
+
},
|
|
24056
|
+
copyRows : function( rows, cm , o) {
|
|
24057
|
+
var seldata =[],header=[], h_s = false, $t = $(rows).parents('table')[0];
|
|
24058
|
+
for(var j=0; j<rows.length;j++) {
|
|
24059
|
+
var row = rows[j];
|
|
24060
|
+
var dat = [];
|
|
24061
|
+
if(row.classList.contains("jqgrow")) {
|
|
24062
|
+
for (var i=0;i<row.cells.length; i++) {
|
|
24063
|
+
if(row.cells[i].classList.contains("selected-cell")) {
|
|
24064
|
+
if(h_s===false) {
|
|
24065
|
+
header.push(cm[i].name);
|
|
24066
|
+
}
|
|
24067
|
+
if(o.copy_formated_data === true) {
|
|
24068
|
+
dat.push( row.cells[i].innerText) ; //? formated data in grid
|
|
24069
|
+
} else {
|
|
24070
|
+
try {
|
|
24071
|
+
dat.push($.unformat.call($t,$(row.cells[i]),{rowId:row.id, colModel:cm[i] }, i ) );
|
|
24072
|
+
} catch(e) {
|
|
24073
|
+
dat.push( $.jgrid.htmlDecode(row.cells[i].innerHTML) ); //as in getCell
|
|
24074
|
+
}
|
|
24075
|
+
}
|
|
24076
|
+
}
|
|
24077
|
+
}
|
|
24078
|
+
if(header.length) {
|
|
24079
|
+
h_s = true;
|
|
24080
|
+
}
|
|
24081
|
+
if(dat.length) {
|
|
24082
|
+
seldata.push( dat.join( o.copy_delimiter ));
|
|
24083
|
+
}
|
|
24084
|
+
}
|
|
24085
|
+
}
|
|
24086
|
+
if(o.copy_header_included && header.length) {
|
|
24087
|
+
seldata.unshift( header.join( o.copy_delimiter ) );
|
|
24088
|
+
}
|
|
24089
|
+
if( $.jgrid.isFunction(o.beforeCopyData)) {
|
|
24090
|
+
o.beforeCopyData.call(this, seldata, o);
|
|
24091
|
+
}
|
|
24092
|
+
$.jgrid.copyText.call($t, seldata.join( o.copy_newline), o);
|
|
24093
|
+
o.startCellIndex = null; o.startRowIndex = null;
|
|
24094
|
+
if( $.jgrid.isFunction(o.afterCopyData)) {
|
|
24095
|
+
o.afterCopyData.call(this, seldata, o);
|
|
24096
|
+
}
|
|
24097
|
+
},
|
|
24098
|
+
pasteRows : function(o, paste_add) {
|
|
24099
|
+
if(o.startCellIndex === null || o.startRowIndex === null) {
|
|
24100
|
+
let msg = $.jgrid.getRegional(this, 'clipboard.msg');
|
|
24101
|
+
$.jgrid.toast({
|
|
24102
|
+
text: msg.select_pos,
|
|
24103
|
+
position:"middle center",
|
|
24104
|
+
autoClose : false,
|
|
24105
|
+
styleUI: this.p.styleUI,
|
|
24106
|
+
type:"warning"
|
|
24107
|
+
});
|
|
24108
|
+
return;
|
|
24109
|
+
}
|
|
24110
|
+
var cm = this.p.colModel, grid_id = this.p.id;
|
|
24111
|
+
$.jgrid.getClipboardContents.call(this).then((data) => {
|
|
24112
|
+
if(data === "" || data == null) {
|
|
24113
|
+
let msg = $.jgrid.getRegional(this, 'clipboard.errors');
|
|
24114
|
+
$.jgrid.toast( {
|
|
24115
|
+
text: msg.get_data_err,
|
|
24116
|
+
styleUI: this.p.styleUI,
|
|
24117
|
+
autoCloseTime: 4500,
|
|
24118
|
+
type:"error"
|
|
24119
|
+
});
|
|
24120
|
+
return;
|
|
24121
|
+
}
|
|
24122
|
+
var delim = o.paste_autodetect_delim ? $.jgrid.guessDelimiters(data) : o.paste_delimiter, headers=[];
|
|
24123
|
+
if( $.jgrid.isFunction(o.beforePasteData)) {
|
|
24124
|
+
o.beforePasteData.call(this, data, delim);
|
|
24125
|
+
}
|
|
24126
|
+
data = data.split(o.paste_newline);
|
|
24127
|
+
if(!o.paste_header_included) {
|
|
24128
|
+
headers = $.jgrid.deserializeRow(data.shift(), delim);
|
|
24129
|
+
} else {
|
|
24130
|
+
var h_l = data[0].split(delim).length;
|
|
24131
|
+
h_l += o.startCellIndex;
|
|
24132
|
+
if(h_l > cm.length) {
|
|
24133
|
+
h_l = cm.length;
|
|
24134
|
+
}
|
|
24135
|
+
for (var i = o.startCellIndex; i< h_l; i++) {
|
|
24136
|
+
headers.push(cm[i].name);
|
|
24137
|
+
}
|
|
24138
|
+
}
|
|
24139
|
+
if($.jgrid.isLocalStorage()) {
|
|
24140
|
+
localStorage.removeItem(grid_id+"_restore");
|
|
24141
|
+
}
|
|
24142
|
+
var rows_to_paste = $.jgrid.CSVtoObject(data, headers, delim, o.paste_newline);
|
|
24143
|
+
$("#"+grid_id).jqGrid("updateRowsByIndex", o.startRowIndex, rows_to_paste, o, paste_add);
|
|
24144
|
+
if( $.jgrid.isFunction(o.afterPasteData)) {
|
|
24145
|
+
o.afterPasteData.call(this, data);
|
|
24146
|
+
}
|
|
24147
|
+
});
|
|
24148
|
+
},
|
|
24149
|
+
undoPaste : function( grid_id ) {
|
|
24150
|
+
if(!$.jgrid.isLocalStorage()) {
|
|
24151
|
+
return;
|
|
24152
|
+
}
|
|
24153
|
+
var data = localStorage.getItem(grid_id+"_restore");
|
|
24154
|
+
if (data) {
|
|
24155
|
+
data = JSON.parse( data );
|
|
24156
|
+
|
|
24157
|
+
if(Array.isArray(data)) {
|
|
24158
|
+
for(let i=0;i<data.length; i++) {
|
|
24159
|
+
$("#"+grid_id).jqGrid("setRowData", data[i]["_id_"], data[i]);
|
|
24160
|
+
}
|
|
24161
|
+
}
|
|
24162
|
+
}
|
|
24163
|
+
var rws = $("#"+grid_id);
|
|
24164
|
+
rws.find("tr.frompaste").each(function(i,n) {
|
|
24165
|
+
rws.jqGrid("delRowData", n.id);
|
|
24166
|
+
});
|
|
24167
|
+
},
|
|
24168
|
+
guessDelimiters : function (data, separators = ['\t', ',', ';', '|']) {
|
|
24169
|
+
const idx = separators
|
|
24170
|
+
.map((separator) => data.indexOf(separator))
|
|
24171
|
+
.reduce((prev, cur) =>
|
|
24172
|
+
prev === -1 || (cur !== -1 && cur < prev) ? cur : prev
|
|
24173
|
+
);
|
|
24174
|
+
return data[idx] || '\t';
|
|
24175
|
+
},
|
|
24176
|
+
repeatRow : function( o ) {
|
|
24177
|
+
var header=[], h_s = false, $t = this;
|
|
24178
|
+
var rows = this.rows, cm = this.p.colModel, source, target, target_ids = [], dat = {}, storeUpdate=[];
|
|
24179
|
+
const err = $.jgrid.getRegional(this, 'clipboard.errors');
|
|
24180
|
+
for(var j=0; j<rows.length;j++) {
|
|
24181
|
+
target = null;
|
|
24182
|
+
var row = rows[j];
|
|
24183
|
+
if(row.classList.contains("jqgrow")) {
|
|
24184
|
+
for (var i=0;i<row.cells.length; i++) {
|
|
24185
|
+
if(row.cells[i].classList.contains("selected-cell")) {
|
|
24186
|
+
if(h_s===false) {
|
|
24187
|
+
header.push(cm[i].name);
|
|
24188
|
+
source = row.id;
|
|
24189
|
+
try {
|
|
24190
|
+
dat[cm[i].name] = $.unformat.call($t,$(row.cells[i]),{rowId:row.id, colModel:cm[i] }, i ) ;
|
|
24191
|
+
} catch(e) {
|
|
24192
|
+
dat[cm[i].name] = $.jgrid.htmlDecode(row.cells[i].innerHTML) ; //as in getCell
|
|
24193
|
+
}
|
|
24194
|
+
} else {
|
|
24195
|
+
target = row.id;
|
|
24196
|
+
}
|
|
24197
|
+
}
|
|
24198
|
+
}
|
|
24199
|
+
if(header.length) {
|
|
24200
|
+
h_s = true;
|
|
24201
|
+
}
|
|
24202
|
+
}
|
|
24203
|
+
if(target !== null ) {
|
|
24204
|
+
var dd = $(this).jqGrid("getRowData", target);
|
|
24205
|
+
dd["_id_"] = target;
|
|
24206
|
+
storeUpdate.push( dd );
|
|
24207
|
+
target_ids.push(target);
|
|
24208
|
+
}
|
|
24209
|
+
}
|
|
24210
|
+
if($.jgrid.isLocalStorage()) {
|
|
24211
|
+
localStorage.removeItem(this.id + "_restore");
|
|
24212
|
+
localStorage.setItem(this.id + "_restore", JSON.stringify(storeUpdate));
|
|
24213
|
+
} else {
|
|
24214
|
+
$.jgrid.toast({
|
|
24215
|
+
text: err.local_stor_err,
|
|
24216
|
+
autoCloseTime: 4500,
|
|
24217
|
+
styleUI: this.p.styleUI,
|
|
24218
|
+
type:"warning"
|
|
24219
|
+
});
|
|
24220
|
+
}
|
|
24221
|
+
for(let j=0;j<target_ids.length;j++) {
|
|
24222
|
+
$(this).jqGrid('setRowData', target_ids[j], dat);
|
|
24223
|
+
}
|
|
24224
|
+
o.startCellIndex = null; o.startRowIndex = null;
|
|
24225
|
+
},
|
|
24226
|
+
repeatCol : function( o ) {
|
|
24227
|
+
var header=[], h_s = false, $t = this;
|
|
24228
|
+
var rows = this.rows, cm = this.p.colModel, target, fcol, target_ids = [], dat = [], storeUpdate=[];
|
|
24229
|
+
const err = $.jgrid.getRegional(this, 'clipboard.errors');
|
|
24230
|
+
for(var j=0; j<rows.length;j++) {
|
|
24231
|
+
target = null; fcol = null;
|
|
24232
|
+
var row = rows[j];
|
|
24233
|
+
if(row.classList.contains("jqgrow")) {
|
|
24234
|
+
for (var i=0;i<row.cells.length; i++) {
|
|
24235
|
+
if(row.cells[i].classList.contains("selected-cell")) {
|
|
24236
|
+
if(h_s===false) {
|
|
24237
|
+
header.push(cm[i].name);
|
|
24238
|
+
}
|
|
24239
|
+
if(fcol===null) {
|
|
24240
|
+
try {
|
|
24241
|
+
dat.push( $.unformat.call($t,$(row.cells[i]),{rowId:row.id, colModel:cm[i] }, i ) );
|
|
24242
|
+
} catch(e) {
|
|
24243
|
+
dat.push( $.jgrid.htmlDecode(row.cells[i].innerHTML) ); //as in getCell
|
|
24244
|
+
}
|
|
24245
|
+
}
|
|
24246
|
+
fcol = true;
|
|
24247
|
+
target = row.id;
|
|
24248
|
+
}
|
|
24249
|
+
}
|
|
24250
|
+
if(header.length) {
|
|
24251
|
+
h_s = true;
|
|
24252
|
+
}
|
|
24253
|
+
}
|
|
24254
|
+
if(target !== null ) {
|
|
24255
|
+
var dd = $(this).jqGrid("getRowData", target);
|
|
24256
|
+
dd["_id_"] = target;
|
|
24257
|
+
storeUpdate.push( dd );
|
|
24258
|
+
target_ids.push(target);
|
|
24259
|
+
}
|
|
24260
|
+
}
|
|
24261
|
+
let setme;
|
|
24262
|
+
header.shift();
|
|
24263
|
+
if($.jgrid.isLocalStorage()) {
|
|
24264
|
+
localStorage.removeItem(this.id + "_restore");
|
|
24265
|
+
localStorage.setItem(this.id + "_restore", JSON.stringify(storeUpdate));
|
|
24266
|
+
} else {
|
|
24267
|
+
$.jgrid.toast({
|
|
24268
|
+
text: err.local_stor_err,
|
|
24269
|
+
autoCloseTime: 4500,
|
|
24270
|
+
styleUI: this.p.styleUI,
|
|
24271
|
+
type:"warning"
|
|
24272
|
+
});
|
|
24273
|
+
}
|
|
24274
|
+
for(let j=0; j < target_ids.length; j++) {
|
|
24275
|
+
setme ={};
|
|
24276
|
+
for (let k=0; k < header.length; k++) {
|
|
24277
|
+
setme[header[k]] = dat[j];
|
|
24278
|
+
}
|
|
24279
|
+
$(this).jqGrid('setRowData', target_ids[j], setme);
|
|
24280
|
+
}
|
|
24281
|
+
o.startCellIndex = null; o.startRowIndex = null;
|
|
24282
|
+
}
|
|
24283
|
+
});
|
|
24284
|
+
$.jgrid.extend({
|
|
24285
|
+
bindSelection : function( o ) {
|
|
24286
|
+
return this.each(function(){
|
|
24287
|
+
var selectTo = function(cell, table) {
|
|
24288
|
+
var row = cell.parent();
|
|
24289
|
+
var cellIndex = cell.index();
|
|
24290
|
+
var rowIndex = row.index();
|
|
24291
|
+
|
|
24292
|
+
var rowStart, rowEnd, cellStart, cellEnd;
|
|
24293
|
+
|
|
24294
|
+
if (rowIndex < o.startRowIndex) {
|
|
24295
|
+
rowStart = rowIndex;
|
|
24296
|
+
rowEnd = o.startRowIndex;
|
|
24297
|
+
} else {
|
|
24298
|
+
rowStart = o.startRowIndex;
|
|
24299
|
+
rowEnd = rowIndex;
|
|
24300
|
+
}
|
|
24301
|
+
|
|
24302
|
+
if (cellIndex < o.startCellIndex) {
|
|
24303
|
+
cellStart = cellIndex;
|
|
24304
|
+
cellEnd = o.startCellIndex;
|
|
24305
|
+
} else {
|
|
24306
|
+
cellStart = o.startCellIndex;
|
|
24307
|
+
cellEnd = cellIndex;
|
|
24308
|
+
}
|
|
24309
|
+
|
|
24310
|
+
for (var i = rowStart; i <= rowEnd; i++) {
|
|
24311
|
+
var rowCells = table.find("tr").eq(i).find("td");
|
|
24312
|
+
for (var j = cellStart; j <= cellEnd; j++) {
|
|
24313
|
+
rowCells.eq(j).addClass(selected);
|
|
24314
|
+
}
|
|
24315
|
+
}
|
|
24316
|
+
};
|
|
24317
|
+
|
|
24318
|
+
var selected = 'selected-cell',
|
|
24319
|
+
table = $("#"+ $.jgrid.jqID( this.p.id ) ),
|
|
24320
|
+
ts = this;
|
|
24321
|
+
table.find("td").on('mousedown.jqgselect',function (e) {
|
|
24322
|
+
|
|
24323
|
+
if(e.which === 3) { // right click button for custom copy/paste
|
|
24324
|
+
var rect = $("#gbox_"+ts.id)[0].getBoundingClientRect();
|
|
24325
|
+
$("#"+ts.p.id+"_copypaste").css({left : e.clientX - rect.left, top: e.clientY - rect.top}).show();
|
|
24326
|
+
return false;
|
|
24327
|
+
}
|
|
24328
|
+
o.isMouseDown = true;
|
|
24329
|
+
var cell = $(this);
|
|
24330
|
+
table.find("."+selected).removeClass(selected); // deselect everything
|
|
24331
|
+
|
|
24332
|
+
if (e.shiftKey) {
|
|
24333
|
+
selectTo(cell, table);
|
|
24334
|
+
} else {
|
|
24335
|
+
cell.addClass(selected);
|
|
24336
|
+
o.startCellIndex = cell.index();
|
|
24337
|
+
o.startRowIndex = cell.parent().index();
|
|
24338
|
+
}
|
|
24339
|
+
return false; // prevent text selection
|
|
24340
|
+
})
|
|
24341
|
+
.on("mouseover.jqgselect",function () {
|
|
24342
|
+
if (!o.isMouseDown) return;
|
|
24343
|
+
table.find("."+ selected).removeClass(selected);
|
|
24344
|
+
selectTo($(this), table);
|
|
24345
|
+
})
|
|
24346
|
+
.on("selectstart.jqgselect", function () {
|
|
24347
|
+
return false;
|
|
24348
|
+
});
|
|
24349
|
+
});
|
|
24350
|
+
},
|
|
24351
|
+
startClipboard : function( prm ) {
|
|
24352
|
+
var o = $.extend({
|
|
24353
|
+
copy_delimiter : '\t',
|
|
24354
|
+
copy_newline: '\n',
|
|
24355
|
+
copy_header_included : true,
|
|
24356
|
+
copy_formated_data : true,
|
|
24357
|
+
show_info_after_copy: true,
|
|
24358
|
+
paste_delimiter : '\t',
|
|
24359
|
+
paste_newline : '\n',
|
|
24360
|
+
paste_autodetect_delim : true,
|
|
24361
|
+
paste_header_included : false,
|
|
24362
|
+
paste_skip_formatter : true,
|
|
24363
|
+
show_info_after_paste: true,
|
|
24364
|
+
beforeCopyData : null,
|
|
24365
|
+
afterCopyData :null,
|
|
24366
|
+
beforePasteData : null,
|
|
24367
|
+
afterPasteData : null,
|
|
24368
|
+
menuConfig : {
|
|
24369
|
+
copy : true,
|
|
24370
|
+
paste: true,
|
|
24371
|
+
paste_add : true,
|
|
24372
|
+
row_vertical : true,
|
|
24373
|
+
row_horizontal : true,
|
|
24374
|
+
undo : true,
|
|
24375
|
+
cancel : true
|
|
24376
|
+
},
|
|
24377
|
+
toastPosition : "top center",
|
|
24378
|
+
userMenus : [],
|
|
24379
|
+
startCellIndex : null,
|
|
24380
|
+
startRowIndex : null,
|
|
24381
|
+
isMouseDown : false
|
|
24382
|
+
}, prm || {});
|
|
24383
|
+
|
|
24384
|
+
return this.each(function(){
|
|
24385
|
+
var colmenustyle = $.jgrid.styleUI[(this.p.styleUI || 'jQueryUI')].colmenu, $t=this;
|
|
24386
|
+
var arf1 = '<ul id="'+this.id+'_copypaste" class="ui-search-menu modal-content column-menu ui-menu jqgrid-caption-menu ' + colmenustyle.menu_widget+'" role="menu" tabindex="0"></ul>';
|
|
24387
|
+
$("#gbox_"+this.id).append(arf1);
|
|
24388
|
+
const menus = $.jgrid.getRegional(this, 'clipboard.menus'),
|
|
24389
|
+
menuicons = $.jgrid.styleUI[(this.p.styleUI || 'jQueryUI')].clipboard,
|
|
24390
|
+
iconbase = $.jgrid.styleUI[(this.p.styleUI || 'jQueryUI')].common.icon_base;
|
|
24391
|
+
var menu = [], menus_copy = [];
|
|
24392
|
+
menu["copy"]= {"id" : "copy_act", icon : iconbase+" "+menuicons.icon_copy ,"title" : menus.copy_act, "click": function() { $.jgrid.copyRows(this.rows,this.p.colModel, o ); } };
|
|
24393
|
+
menu["paste"] = {"id" : "paste_act", icon : iconbase+" "+menuicons.icon_paste, "title" : menus.paste_act, "click": function() { $.jgrid.pasteRows.call(this, o, false); } };
|
|
24394
|
+
menu["paste_add"] = {"id" : "paste_act_add", icon : iconbase+" "+menuicons.icon_paste_add, "title" : menus.paste_act_add, "click": function() { $.jgrid.pasteRows.call(this, o, true); } };
|
|
24395
|
+
menu["row_vertical"] = {"id" : "repeat_act_row", icon : iconbase+" "+menuicons.icon_repeat_row, "title" : menus.repeat_act_row, "click": function() { $.jgrid.repeatRow.call( this, o); } };
|
|
24396
|
+
menu["row_horizontal"] = {"id" : "repeat_act_col", icon : iconbase+" "+menuicons.icon_repeat_col, "title" : menus.repeat_act_col, "click": function() { $.jgrid.repeatCol.call( this, o); } };
|
|
24397
|
+
menu["undo"] = {"id" : "undo_act", icon : iconbase+" "+menuicons.icon_undo, "title" : menus.undo_act, "click": function() { $.jgrid.undoPaste( this.id, o); } };
|
|
24398
|
+
menu["cancel"] = {"id" : "cancel_act", icon : iconbase+" "+menuicons.icon_cancel, "title" : menus.cancel_act, "click": function() { $("#"+$t.p.id+"_copypaste").hide(); } };
|
|
24399
|
+
//return;
|
|
24400
|
+
var cnt =0;
|
|
24401
|
+
for(let key in o.menuConfig) {
|
|
24402
|
+
if(Object.hasOwn(o.menuConfig, key) && o.menuConfig[key] === true) {
|
|
24403
|
+
cnt++;
|
|
24404
|
+
if(cnt > 1) {
|
|
24405
|
+
menus_copy.push({divider : true});
|
|
24406
|
+
}
|
|
24407
|
+
menus_copy.push(menu[key]);
|
|
24408
|
+
}
|
|
24409
|
+
}
|
|
24410
|
+
if(Array.isArray(o.userMenus) ) {
|
|
24411
|
+
for(let i=0; i< o.userMenus.length; i++) {
|
|
24412
|
+
menus_copy.push( o.userMenus[i] );
|
|
24413
|
+
}
|
|
24414
|
+
}
|
|
24415
|
+
$(this).jqGrid("menubarAdd", menus_copy, "_copypaste");
|
|
24416
|
+
$(this).on('jqGridAfterGridComplete.setBindSelections',function(){
|
|
24417
|
+
$(this).jqGrid('bindSelection', o);
|
|
24418
|
+
o.startCellIndex = o.startRowIndex = null;
|
|
24419
|
+
});
|
|
24420
|
+
$(this).on('jqGridRightClickRow.setBindSelections',function(){
|
|
24421
|
+
//console.log(e, id, iRow, iCol, e1);
|
|
24422
|
+
return false;
|
|
24423
|
+
});
|
|
24424
|
+
$(document).on("mouseup.jqgclipme", function () {
|
|
24425
|
+
o.isMouseDown = false;
|
|
24426
|
+
});
|
|
24427
|
+
$("body").on('click.jqgclipme', function(e){
|
|
24428
|
+
if(!$(e.target).closest(".ui-jqgrid-menubar").length) {
|
|
24429
|
+
try {
|
|
24430
|
+
$("#"+$t.p.id+"_copypaste").hide();
|
|
24431
|
+
} catch (e1) {}
|
|
24432
|
+
}
|
|
24433
|
+
});
|
|
24434
|
+
$.jgrid.Permissions.call(this);
|
|
24435
|
+
$t.p.isClipboard = true;
|
|
24436
|
+
$(this).jqGrid('bindSelection', o);
|
|
24437
|
+
o.startCellIndex = o.startRowIndex = null;
|
|
24438
|
+
});
|
|
24439
|
+
},
|
|
24440
|
+
stopClipboard : function() {
|
|
24441
|
+
//
|
|
24442
|
+
return this.each(function(){
|
|
24443
|
+
var selected = 'selected-cell';
|
|
24444
|
+
$("#"+this.p.id+"_copypaste").remove();
|
|
24445
|
+
$("body").off("click.jqgclipme");
|
|
24446
|
+
$(document).off("mouseup.jqgclipme");
|
|
24447
|
+
$(this)
|
|
24448
|
+
.off("jqGridAfterGridComplete.setBindSelections")
|
|
24449
|
+
.off("jqGridAfterGridComplete.setBindSelections")
|
|
24450
|
+
.find("td")
|
|
24451
|
+
.removeClass(selected)
|
|
24452
|
+
.off("mousedown.jqgselect")
|
|
24453
|
+
.off("mouseover.jqgselect")
|
|
24454
|
+
.off("selectstart.jqgselect");
|
|
24455
|
+
this.p.isClipboard = false;
|
|
24456
|
+
});
|
|
24457
|
+
},
|
|
24458
|
+
updateRowsByIndex : function(startInd, data, o, paste_add) {
|
|
24459
|
+
var success = true;
|
|
24460
|
+
this.each(function(){
|
|
24461
|
+
const err = $.jgrid.getRegional(this, 'clipboard.errors');
|
|
24462
|
+
const msg = $.jgrid.getRegional(this, 'clipboard.msg');
|
|
24463
|
+
if(Array.isArray(data)) {
|
|
24464
|
+
startInd = parseInt(startInd,10);
|
|
24465
|
+
if(startInd < 0 ) {
|
|
24466
|
+
success = false;
|
|
24467
|
+
$.jgrid.toast( {
|
|
24468
|
+
text: err.start_ind_err,
|
|
24469
|
+
styleUI: this.p.styleUI,
|
|
24470
|
+
autoCloseTime: 4500,
|
|
24471
|
+
type:"error"
|
|
24472
|
+
});
|
|
24473
|
+
} else {
|
|
24474
|
+
var datalen = data.length, i=0, row, grow, storeUpdate = [], inserted = 0, updated =0;
|
|
24475
|
+
while(i < datalen) {
|
|
24476
|
+
row = data[i];
|
|
24477
|
+
grow = this.rows[startInd];
|
|
24478
|
+
if( !grow || paste_add===true) {
|
|
24479
|
+
$(this).jqGrid("addRowData", null, row, "last", null, "frompaste");// perform add
|
|
24480
|
+
inserted++;
|
|
24481
|
+
} else {
|
|
24482
|
+
let o_row = $(this).jqGrid("getRowData", grow.id);
|
|
24483
|
+
if( !$.isEmptyObject(o_row) ) {
|
|
24484
|
+
o_row["_id_"] = grow.id;
|
|
24485
|
+
data[i]["_id_"] = grow.id;
|
|
24486
|
+
storeUpdate.push( o_row );
|
|
24487
|
+
$(this).jqGrid("setRowData", grow.id, row, undefined , false, o.paste_skip_formatter);
|
|
24488
|
+
updated++;
|
|
24489
|
+
}
|
|
24490
|
+
|
|
24491
|
+
}
|
|
24492
|
+
i++;
|
|
24493
|
+
startInd++;
|
|
24494
|
+
}
|
|
24495
|
+
if(storeUpdate.length) {
|
|
24496
|
+
if($.jgrid.isLocalStorage()) {
|
|
24497
|
+
localStorage.setItem(this.id+"_restore", JSON.stringify(storeUpdate));
|
|
24498
|
+
} else {
|
|
24499
|
+
$.jgrid.toast({
|
|
24500
|
+
text: err.local_stor_err,
|
|
24501
|
+
autoCloseTime: 4500,
|
|
24502
|
+
styleUI: this.p.styleUI,
|
|
24503
|
+
type:"warning"
|
|
24504
|
+
});
|
|
24505
|
+
}
|
|
24506
|
+
}
|
|
24507
|
+
if(o.show_info_after_paste) {
|
|
24508
|
+
$.jgrid.info_dialog(msg.info_cap,'<div>'+msg.total_row +datalen + '</div><div>'+msg.insert_row + inserted+ '</div><div>'+msg.update_row + updated +'</div>','',{styleUI : this.p.styleUI ,autoClose: true, autoCloseTime:4500});
|
|
24509
|
+
}
|
|
24510
|
+
}
|
|
24511
|
+
} else {
|
|
24512
|
+
success = false;
|
|
24513
|
+
$.jgrid.toast({
|
|
24514
|
+
text: err.not_array_err,
|
|
24515
|
+
autoCloseTime:3500,
|
|
24516
|
+
styleUI: this.p.styleUI,
|
|
24517
|
+
type:"error"
|
|
24518
|
+
});
|
|
24519
|
+
}
|
|
24520
|
+
});
|
|
24521
|
+
return success;
|
|
24522
|
+
}
|
|
24523
|
+
// end clipboard grid
|
|
24524
|
+
});
|
|
24525
|
+
//clipboard
|
|
24526
|
+
|
|
24281
24527
|
}));
|