rails_jq_grid 0.0.3.pre2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. data/VERSION +1 -1
  2. data/public/javascripts/rails-jqgrid/Changes.txt +0 -0
  3. data/public/javascripts/rails-jqgrid/i18n/grid.locale-bg.js +132 -1
  4. data/public/javascripts/rails-jqgrid/i18n/grid.locale-bg1251.js +132 -1
  5. data/public/javascripts/rails-jqgrid/i18n/grid.locale-cat.js +128 -1
  6. data/public/javascripts/rails-jqgrid/i18n/grid.locale-cn.js +132 -1
  7. data/public/javascripts/rails-jqgrid/i18n/grid.locale-cs.js +128 -1
  8. data/public/javascripts/rails-jqgrid/i18n/grid.locale-da.js +128 -0
  9. data/public/javascripts/rails-jqgrid/i18n/grid.locale-de.js +133 -1
  10. data/public/javascripts/rails-jqgrid/i18n/grid.locale-el.js +126 -1
  11. data/public/javascripts/rails-jqgrid/i18n/grid.locale-en.js +128 -1
  12. data/public/javascripts/rails-jqgrid/i18n/grid.locale-es.js +128 -1
  13. data/public/javascripts/rails-jqgrid/i18n/grid.locale-fa.js +145 -1
  14. data/public/javascripts/rails-jqgrid/i18n/grid.locale-fi.js +130 -1
  15. data/public/javascripts/rails-jqgrid/i18n/grid.locale-fr.js +126 -1
  16. data/public/javascripts/rails-jqgrid/i18n/grid.locale-gl.js +126 -0
  17. data/public/javascripts/rails-jqgrid/i18n/grid.locale-he.js +127 -1
  18. data/public/javascripts/rails-jqgrid/i18n/grid.locale-hu.js +129 -1
  19. data/public/javascripts/rails-jqgrid/i18n/grid.locale-is.js +126 -1
  20. data/public/javascripts/rails-jqgrid/i18n/grid.locale-it.js +1 -1
  21. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ja.js +155 -1
  22. data/public/javascripts/rails-jqgrid/i18n/grid.locale-nl.js +149 -1
  23. data/public/javascripts/rails-jqgrid/i18n/grid.locale-no.js +1 -1
  24. data/public/javascripts/rails-jqgrid/i18n/grid.locale-pl.js +127 -1
  25. data/public/javascripts/rails-jqgrid/i18n/grid.locale-pt-br.js +127 -1
  26. data/public/javascripts/rails-jqgrid/i18n/grid.locale-pt.js +125 -1
  27. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ro.js +139 -1
  28. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ru.js +127 -1
  29. data/public/javascripts/rails-jqgrid/i18n/grid.locale-sk.js +127 -1
  30. data/public/javascripts/rails-jqgrid/i18n/grid.locale-sr.js +128 -0
  31. data/public/javascripts/rails-jqgrid/i18n/grid.locale-sv.js +127 -1
  32. data/public/javascripts/rails-jqgrid/i18n/grid.locale-tr.js +126 -1
  33. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ua.js +127 -1
  34. data/public/javascripts/rails-jqgrid/install.txt +0 -0
  35. data/public/javascripts/rails-jqgrid/jquery.jqGrid.min.js +445 -432
  36. data/public/javascripts/rails-jqgrid/src/JsonXml.js +329 -329
  37. data/public/javascripts/rails-jqgrid/src/css/ellipsis-xbl.xml +0 -0
  38. data/public/javascripts/rails-jqgrid/src/css/ui.jqgrid.css +139 -129
  39. data/public/javascripts/rails-jqgrid/src/css/ui.multiselect.css +0 -0
  40. data/public/javascripts/rails-jqgrid/src/grid.base.js +3078 -3003
  41. data/public/javascripts/rails-jqgrid/src/grid.celledit.js +486 -486
  42. data/public/javascripts/rails-jqgrid/src/grid.common.js +646 -636
  43. data/public/javascripts/rails-jqgrid/src/grid.custom.js +820 -817
  44. data/public/javascripts/rails-jqgrid/src/grid.formedit.js +1954 -1872
  45. data/public/javascripts/rails-jqgrid/src/grid.grouping.js +250 -0
  46. data/public/javascripts/rails-jqgrid/src/grid.import.js +200 -200
  47. data/public/javascripts/rails-jqgrid/src/grid.inlinedit.js +255 -250
  48. data/public/javascripts/rails-jqgrid/src/grid.jqueryui.js +504 -503
  49. data/public/javascripts/rails-jqgrid/src/grid.loader.js +1 -0
  50. data/public/javascripts/rails-jqgrid/src/grid.postext.js +63 -63
  51. data/public/javascripts/rails-jqgrid/src/grid.setcolumns.js +125 -125
  52. data/public/javascripts/rails-jqgrid/src/grid.subgrid.js +260 -260
  53. data/public/javascripts/rails-jqgrid/src/grid.tbltogrid.js +106 -106
  54. data/public/javascripts/rails-jqgrid/src/grid.treegrid.js +489 -482
  55. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-bg.js +132 -132
  56. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-bg1251.js +132 -132
  57. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cat.js +128 -128
  58. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cn.js +132 -132
  59. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cs.js +128 -128
  60. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-da.js +128 -0
  61. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-de.js +132 -127
  62. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-dk.js +0 -0
  63. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-el.js +126 -126
  64. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-en.js +128 -128
  65. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-es.js +128 -128
  66. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fa.js +145 -125
  67. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fi.js +130 -130
  68. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fr.js +2 -2
  69. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-gl.js +126 -0
  70. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-he.js +127 -127
  71. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-hu.js +129 -129
  72. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-is.js +126 -126
  73. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-it.js +0 -0
  74. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ja.js +155 -155
  75. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-nl.js +148 -148
  76. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-no.js +0 -0
  77. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pl.js +126 -126
  78. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pt-br.js +127 -127
  79. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pt.js +125 -125
  80. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ro.js +139 -139
  81. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ru.js +127 -127
  82. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sk.js +127 -127
  83. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sr.js +128 -0
  84. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sv.js +127 -127
  85. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-tr.js +126 -126
  86. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ua.js +127 -127
  87. data/public/javascripts/rails-jqgrid/src/jqDnR.js +68 -67
  88. data/public/javascripts/rails-jqgrid/src/jqModal.js +68 -68
  89. data/public/javascripts/rails-jqgrid/src/jquery.fmatter.js +563 -541
  90. data/public/javascripts/rails-jqgrid/src/jquery.searchFilter.js +1 -1
  91. data/public/javascripts/rails-jqgrid/src/ui.multiselect.js +0 -0
  92. data/public/stylesheets/rails-jqgrid/ellipsis-xbl.xml +0 -0
  93. data/public/stylesheets/rails-jqgrid/ui.jqgrid.css +139 -2
  94. data/rails_jq_grid.gemspec +10 -3
  95. metadata +15 -11
@@ -17,6 +17,7 @@ function jqGridInclude()
17
17
  { include: true, incfile:'grid.tbltogrid.js'}, //jqGrid table to grid
18
18
  { include: true, incfile:'grid.setcolumns.js'}, //jqGrid setcolumns
19
19
  { include: true, incfile:'grid.import.js'}, //jqGrid import
20
+ { include: true, incfile:'grid.grouping.js'}, //jqGrid grouping
20
21
  { include: true, incfile:'jquery.fmatter.js'}, //jqGrid formater
21
22
  { include: true, incfile:'JsonXml.js'}, //xmljson utils
22
23
  { include: true, incfile:'jquery.searchFilter.js'} // search Plugin
@@ -1,64 +1,64 @@
1
- ;(function($){
2
- /**
3
- * jqGrid extension
4
- * Paul Tiseo ptiseo@wasteconsultants.com
5
- *
6
- * Dual licensed under the MIT and GPL licenses:
7
- * http://www.opensource.org/licenses/mit-license.php
8
- * http://www.gnu.org/licenses/gpl-2.0.html
9
- **/
10
- $.jgrid.extend({
11
- getPostData : function(){
12
- var $t = this[0];
13
- if(!$t.grid) { return; }
14
- return $t.p.postData;
15
- },
16
- setPostData : function( newdata ) {
17
- var $t = this[0];
18
- if(!$t.grid) { return; }
19
- // check if newdata is correct type
20
- if ( typeof(newdata) === 'object' ) {
21
- $t.p.postData = newdata;
22
- }
23
- else {
24
- alert("Error: cannot add a non-object postData value. postData unchanged.");
25
- }
26
- },
27
- appendPostData : function( newdata ) {
28
- var $t = this[0];
29
- if(!$t.grid) { return; }
30
- // check if newdata is correct type
31
- if ( typeof(newdata) === 'object' ) {
32
- $.extend($t.p.postData, newdata);
33
- }
34
- else {
35
- alert("Error: cannot append a non-object postData value. postData unchanged.");
36
- }
37
- },
38
- setPostDataItem : function( key, val ) {
39
- var $t = this[0];
40
- if(!$t.grid) { return; }
41
- $t.p.postData[key] = val;
42
- },
43
- getPostDataItem : function( key ) {
44
- var $t = this[0];
45
- if(!$t.grid) { return; }
46
- return $t.p.postData[key];
47
- },
48
- removePostDataItem : function( key ) {
49
- var $t = this[0];
50
- if(!$t.grid) { return; }
51
- delete $t.p.postData[key];
52
- },
53
- getUserData : function(){
54
- var $t = this[0];
55
- if(!$t.grid) { return; }
56
- return $t.p.userData;
57
- },
58
- getUserDataItem : function( key ) {
59
- var $t = this[0];
60
- if(!$t.grid) { return; }
61
- return $t.p.userData[key];
62
- }
63
- });
1
+ ;(function($){
2
+ /**
3
+ * jqGrid extension
4
+ * Paul Tiseo ptiseo@wasteconsultants.com
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl-2.0.html
9
+ **/
10
+ $.jgrid.extend({
11
+ getPostData : function(){
12
+ var $t = this[0];
13
+ if(!$t.grid) { return; }
14
+ return $t.p.postData;
15
+ },
16
+ setPostData : function( newdata ) {
17
+ var $t = this[0];
18
+ if(!$t.grid) { return; }
19
+ // check if newdata is correct type
20
+ if ( typeof(newdata) === 'object' ) {
21
+ $t.p.postData = newdata;
22
+ }
23
+ else {
24
+ alert("Error: cannot add a non-object postData value. postData unchanged.");
25
+ }
26
+ },
27
+ appendPostData : function( newdata ) {
28
+ var $t = this[0];
29
+ if(!$t.grid) { return; }
30
+ // check if newdata is correct type
31
+ if ( typeof(newdata) === 'object' ) {
32
+ $.extend($t.p.postData, newdata);
33
+ }
34
+ else {
35
+ alert("Error: cannot append a non-object postData value. postData unchanged.");
36
+ }
37
+ },
38
+ setPostDataItem : function( key, val ) {
39
+ var $t = this[0];
40
+ if(!$t.grid) { return; }
41
+ $t.p.postData[key] = val;
42
+ },
43
+ getPostDataItem : function( key ) {
44
+ var $t = this[0];
45
+ if(!$t.grid) { return; }
46
+ return $t.p.postData[key];
47
+ },
48
+ removePostDataItem : function( key ) {
49
+ var $t = this[0];
50
+ if(!$t.grid) { return; }
51
+ delete $t.p.postData[key];
52
+ },
53
+ getUserData : function(){
54
+ var $t = this[0];
55
+ if(!$t.grid) { return; }
56
+ return $t.p.userData;
57
+ },
58
+ getUserDataItem : function( key ) {
59
+ var $t = this[0];
60
+ if(!$t.grid) { return; }
61
+ return $t.p.userData[key];
62
+ }
63
+ });
64
64
  })(jQuery);
@@ -1,126 +1,126 @@
1
- ;(function($){
2
- /**
3
- * jqGrid extension for manipulating columns properties
4
- * Piotr Roznicki roznicki@o2.pl
5
- * http://www.roznicki.prv.pl
6
- * Dual licensed under the MIT and GPL licenses:
7
- * http://www.opensource.org/licenses/mit-license.php
8
- * http://www.gnu.org/licenses/gpl-2.0.html
9
- **/
10
- $.jgrid.extend({
11
- setColumns : function(p) {
12
- p = $.extend({
13
- top : 0,
14
- left: 0,
15
- width: 200,
16
- height: 'auto',
17
- dataheight: 'auto',
18
- modal: false,
19
- drag: true,
20
- beforeShowForm: null,
21
- afterShowForm: null,
22
- afterSubmitForm: null,
23
- closeOnEscape : true,
24
- ShrinkToFit : false,
25
- jqModal : false,
26
- saveicon: [true,"left","ui-icon-disk"],
27
- closeicon: [true,"left","ui-icon-close"],
28
- onClose : null,
29
- colnameview : true,
30
- closeAfterSubmit : true,
31
- updateAfterCheck : false,
32
- recreateForm : false
33
- }, $.jgrid.col, p ||{});
34
- return this.each(function(){
35
- var $t = this;
36
- if (!$t.grid ) { return; }
37
- var onBeforeShow = typeof p.beforeShowForm === 'function' ? true: false;
38
- var onAfterShow = typeof p.afterShowForm === 'function' ? true: false;
39
- var onAfterSubmit = typeof p.afterSubmitForm === 'function' ? true: false;
40
- var gID = $t.p.id,
41
- dtbl = "ColTbl_"+gID,
42
- IDs = {themodal:'colmod'+gID,modalhead:'colhd'+gID,modalcontent:'colcnt'+gID, scrollelm: dtbl};
43
- if(p.recreateForm===true && $("#"+IDs.themodal).html() != null) {
44
- $("#"+IDs.themodal).remove();
45
- }
46
- if ( $("#"+IDs.themodal).html() != null ) {
47
- if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
48
- viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM:false, modal:p.modal});
49
- if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
50
- } else {
51
- var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
52
- var formdata = "<div id='"+dtbl+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+dh+";'>";
53
- formdata += "<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";
54
- for(i=0;i<this.p.colNames.length;i++){
55
- if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
56
- formdata += "<tr><td style='white-space: pre;'><input type='checkbox' style='margin-right:5px;' id='col_" + this.p.colModel[i].name + "' class='cbox' value='T' " +
57
- ((this.p.colModel[i].hidden===false)?"checked":"") + "/>" + "<label for='col_" + this.p.colModel[i].name + "'>" + this.p.colNames[i] + ((p.colnameview) ? " (" + this.p.colModel[i].name + ")" : "" )+ "</label></td></tr>";
58
- }
59
- }
60
- formdata += "</tbody></table></div>"
61
- var bS = !p.updateAfterCheck ? "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>" : "",
62
- bC ="<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
63
- formdata += "<table border='0' class='EditTable' id='"+dtbl+"_2'><tbody><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DataTD ui-widget-content'></td></tr><tr><td class='ColButton EditButton'>"+bS+"&#160;"+bC+"</td></tr></tbody></table>";
64
- p.gbox = "#gbox_"+gID;
65
- createModal(IDs,formdata,p,"#gview_"+$t.p.id,$("#gview_"+$t.p.id)[0]);
66
- if(p.saveicon[0]==true) {
67
- $("#dData","#"+dtbl+"_2").addClass(p.saveicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
68
- .append("<span class='ui-icon "+p.saveicon[2]+"'></span>");
69
- }
70
- if(p.closeicon[0]==true) {
71
- $("#eData","#"+dtbl+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
72
- .append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
73
- }
74
- if(!p.updateAfterCheck) {
75
- $("#dData","#"+dtbl+"_2").click(function(e){
76
- for(i=0;i<$t.p.colModel.length;i++){
77
- if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
78
- var nm = $t.p.colModel[i].name.replace(".", "\\.");
79
- if($("#col_" + nm,"#"+dtbl).attr("checked")) {
80
- $($t).jqGrid("showCol",$t.p.colModel[i].name);
81
- $("#col_" + nm,"#"+dtbl).attr("defaultChecked",true); // Added from T. Tomov IE BUG
82
- } else {
83
- $($t).jqGrid("hideCol",$t.p.colModel[i].name);
84
- $("#col_" + nm,"#"+dtbl).attr("defaultChecked",""); // Added from T. Tomov IE BUG
85
- }
86
- }
87
- }
88
- if(p.ShrinkToFit===true) {
89
- $($t).jqGrid("setGridWidth",$t.grid.width-0.001,true);
90
- }
91
- if(p.closeAfterSubmit) hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
92
- if (onAfterSubmit) { p.afterSubmitForm($("#"+dtbl)); }
93
- return false;
94
- });
95
- } else {
96
- $(":input","#"+dtbl).click(function(e){
97
- var cn = this.id.substr(4);
98
- if(cn){
99
- if(this.checked) {
100
- $($t).jqGrid("showCol",cn);
101
- } else {
102
- $($t).jqGrid("hideCol",cn);
103
- }
104
- if(p.ShrinkToFit===true) {
105
- $($t).jqGrid("setGridWidth",$t.grid.width-0.001,true);
106
- }
107
- }
108
- return this;
109
- });
110
- }
111
- $("#eData", "#"+dtbl+"_2").click(function(e){
112
- hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
113
- return false;
114
- });
115
- $("#dData, #eData","#"+dtbl+"_2").hover(
116
- function(){$(this).addClass('ui-state-hover');},
117
- function(){$(this).removeClass('ui-state-hover');}
118
- );
119
- if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
120
- viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM: true, modal:p.modal});
121
- if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
122
- }
123
- });
124
- }
125
- });
1
+ ;(function($){
2
+ /**
3
+ * jqGrid extension for manipulating columns properties
4
+ * Piotr Roznicki roznicki@o2.pl
5
+ * http://www.roznicki.prv.pl
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl-2.0.html
9
+ **/
10
+ $.jgrid.extend({
11
+ setColumns : function(p) {
12
+ p = $.extend({
13
+ top : 0,
14
+ left: 0,
15
+ width: 200,
16
+ height: 'auto',
17
+ dataheight: 'auto',
18
+ modal: false,
19
+ drag: true,
20
+ beforeShowForm: null,
21
+ afterShowForm: null,
22
+ afterSubmitForm: null,
23
+ closeOnEscape : true,
24
+ ShrinkToFit : false,
25
+ jqModal : false,
26
+ saveicon: [true,"left","ui-icon-disk"],
27
+ closeicon: [true,"left","ui-icon-close"],
28
+ onClose : null,
29
+ colnameview : true,
30
+ closeAfterSubmit : true,
31
+ updateAfterCheck : false,
32
+ recreateForm : false
33
+ }, $.jgrid.col, p ||{});
34
+ return this.each(function(){
35
+ var $t = this;
36
+ if (!$t.grid ) { return; }
37
+ var onBeforeShow = typeof p.beforeShowForm === 'function' ? true: false;
38
+ var onAfterShow = typeof p.afterShowForm === 'function' ? true: false;
39
+ var onAfterSubmit = typeof p.afterSubmitForm === 'function' ? true: false;
40
+ var gID = $t.p.id,
41
+ dtbl = "ColTbl_"+gID,
42
+ IDs = {themodal:'colmod'+gID,modalhead:'colhd'+gID,modalcontent:'colcnt'+gID, scrollelm: dtbl};
43
+ if(p.recreateForm===true && $("#"+IDs.themodal).html() != null) {
44
+ $("#"+IDs.themodal).remove();
45
+ }
46
+ if ( $("#"+IDs.themodal).html() != null ) {
47
+ if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
48
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM:false, modal:p.modal});
49
+ if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
50
+ } else {
51
+ var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
52
+ var formdata = "<div id='"+dtbl+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+dh+";'>";
53
+ formdata += "<table class='ColTable' cellspacing='1' cellpading='2' border='0'><tbody>";
54
+ for(i=0;i<this.p.colNames.length;i++){
55
+ if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
56
+ formdata += "<tr><td style='white-space: pre;'><input type='checkbox' style='margin-right:5px;' id='col_" + this.p.colModel[i].name + "' class='cbox' value='T' " +
57
+ ((this.p.colModel[i].hidden===false)?"checked":"") + "/>" + "<label for='col_" + this.p.colModel[i].name + "'>" + this.p.colNames[i] + ((p.colnameview) ? " (" + this.p.colModel[i].name + ")" : "" )+ "</label></td></tr>";
58
+ }
59
+ }
60
+ formdata += "</tbody></table></div>"
61
+ var bS = !p.updateAfterCheck ? "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>" : "",
62
+ bC ="<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
63
+ formdata += "<table border='0' class='EditTable' id='"+dtbl+"_2'><tbody><tr style='display:block;height:3px;'><td></td></tr><tr><td class='DataTD ui-widget-content'></td></tr><tr><td class='ColButton EditButton'>"+bS+"&#160;"+bC+"</td></tr></tbody></table>";
64
+ p.gbox = "#gbox_"+gID;
65
+ $.jgrid.createModal(IDs,formdata,p,"#gview_"+$t.p.id,$("#gview_"+$t.p.id)[0]);
66
+ if(p.saveicon[0]==true) {
67
+ $("#dData","#"+dtbl+"_2").addClass(p.saveicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
68
+ .append("<span class='ui-icon "+p.saveicon[2]+"'></span>");
69
+ }
70
+ if(p.closeicon[0]==true) {
71
+ $("#eData","#"+dtbl+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
72
+ .append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
73
+ }
74
+ if(!p.updateAfterCheck) {
75
+ $("#dData","#"+dtbl+"_2").click(function(e){
76
+ for(i=0;i<$t.p.colModel.length;i++){
77
+ if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
78
+ var nm = $t.p.colModel[i].name.replace(/\./g, "\\.");
79
+ if($("#col_" + nm,"#"+dtbl).attr("checked")) {
80
+ $($t).jqGrid("showCol",$t.p.colModel[i].name);
81
+ $("#col_" + nm,"#"+dtbl).attr("defaultChecked",true); // Added from T. Tomov IE BUG
82
+ } else {
83
+ $($t).jqGrid("hideCol",$t.p.colModel[i].name);
84
+ $("#col_" + nm,"#"+dtbl).attr("defaultChecked",""); // Added from T. Tomov IE BUG
85
+ }
86
+ }
87
+ }
88
+ if(p.ShrinkToFit===true) {
89
+ $($t).jqGrid("setGridWidth",$t.grid.width-0.001,true);
90
+ }
91
+ if(p.closeAfterSubmit) $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
92
+ if (onAfterSubmit) { p.afterSubmitForm($("#"+dtbl)); }
93
+ return false;
94
+ });
95
+ } else {
96
+ $(":input","#"+dtbl).click(function(e){
97
+ var cn = this.id.substr(4);
98
+ if(cn){
99
+ if(this.checked) {
100
+ $($t).jqGrid("showCol",cn);
101
+ } else {
102
+ $($t).jqGrid("hideCol",cn);
103
+ }
104
+ if(p.ShrinkToFit===true) {
105
+ $($t).jqGrid("setGridWidth",$t.grid.width-0.001,true);
106
+ }
107
+ }
108
+ return this;
109
+ });
110
+ }
111
+ $("#eData", "#"+dtbl+"_2").click(function(e){
112
+ $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
113
+ return false;
114
+ });
115
+ $("#dData, #eData","#"+dtbl+"_2").hover(
116
+ function(){$(this).addClass('ui-state-hover');},
117
+ function(){$(this).removeClass('ui-state-hover');}
118
+ );
119
+ if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
120
+ $.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM: true, modal:p.modal});
121
+ if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
122
+ }
123
+ });
124
+ }
125
+ });
126
126
  })(jQuery);
@@ -1,260 +1,260 @@
1
- ;(function($){
2
- /**
3
- * jqGrid extension for SubGrid Data
4
- * Tony Tomov tony@trirand.com
5
- * http://trirand.com/blog/
6
- * Dual licensed under the MIT and GPL licenses:
7
- * http://www.opensource.org/licenses/mit-license.php
8
- * http://www.gnu.org/licenses/gpl-2.0.html
9
- **/
10
- $.jgrid.extend({
11
- setSubGrid : function () {
12
- return this.each(function (){
13
- var $t = this, cm;
14
- $t.p.colNames.unshift("");
15
- $t.p.colModel.unshift({name:'subgrid',width: $.browser.safari ? $t.p.subGridWidth+$t.p.cellLayout : $t.p.subGridWidth,sortable: false,resizable:false,hidedlg:true,search:false,fixed:true});
16
- cm = $t.p.subGridModel;
17
- if(cm[0]) {
18
- cm[0].align = $.extend([],cm[0].align || []);
19
- for(var i=0;i<cm[0].name.length;i++) { cm[0].align[i] = cm[0].align[i] || 'left';}
20
- }
21
- });
22
- },
23
- addSubGridCell :function (pos,iRow) {
24
- var prp='',gv,sid;
25
- this.each(function(){
26
- prp = this.formatCol(pos,iRow);
27
- gv = this.p.gridview;
28
- sid= this.p.id;
29
- });
30
- if( gv === false ){
31
- return "<td role=\"grid\" aria-describedby=\""+sid+"_subgrid\" class=\"ui-sgcollapsed sgcollapsed\" "+prp+"><a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a></td>";
32
- } else {
33
- return "<td role=\"grid\" aria-describedby=\""+sid+"_subgrid\" " +prp +"></td>";
34
- }
35
- },
36
- addSubGrid : function(t,pos) {
37
- return this.each(function(){
38
- var ts = this;
39
- if (!ts.grid ) { return; }
40
- var res,_id, pID,atd, nhc, subdata, bfsc;
41
- $("td:eq("+pos+")",t).click( function(e) {
42
- if($(this).hasClass("sgcollapsed")) {
43
- pID = ts.p.id;
44
- res = $(this).parent();
45
- atd = pos >=1 ? "<td colspan='"+pos+"'>&#160;</td>":"";
46
- _id = $(res).attr("id");
47
- bfsc =true;
48
- if($.isFunction(ts.p.subGridBeforeExpand)) {
49
- bfsc = ts.p.subGridBeforeExpand(pID+"_"+_id,_id);
50
- }
51
- if(bfsc === false) {return false;}
52
- nhc = 0;
53
- $.each(ts.p.colModel,function(i,v){
54
- if(this.hidden === true || this.name == 'rn' || this.name == 'cb') {nhc++;}
55
- });
56
- subdata = "<tr role='row' class='ui-subgrid'>"+atd+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon ui-icon-carat-1-sw'/></td><td colspan='"+parseInt(ts.p.colNames.length-1-nhc,10)+"' class='ui-widget-content subgrid-data'><div id="+pID+"_"+_id+" class='tablediv'>";
57
- $(this).parent().after( subdata+ "</div></td></tr>" );
58
- if( $.isFunction(ts.p.subGridRowExpanded)) {
59
- ts.p.subGridRowExpanded(pID+"_"+ _id,_id);
60
- } else {
61
- populatesubgrid(res);
62
- }
63
- $(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-minus'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded");
64
- } else if($(this).hasClass("sgexpanded")) {
65
- bfsc = true;
66
- if( $.isFunction(ts.p.subGridRowColapsed)) {
67
- res = $(this).parent();
68
- _id = $(res).attr("id");
69
- bfsc = ts.p.subGridRowColapsed(pID+"_"+_id,_id );
70
- }
71
- if(bfsc===false) {return false;}
72
- $(this).parent().next().remove(".ui-subgrid");
73
- $(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed");
74
- }
75
- return false;
76
- });
77
- //-------------------------
78
- var populatesubgrid = function( rd ) {
79
- var res,sid,dp, i, j;
80
- sid = $(rd).attr("id");
81
- dp = {nd_: (new Date().getTime())};
82
- dp[ts.p.prmNames.subgridid]=sid;
83
- if(!ts.p.subGridModel[0]) { return false; }
84
- if(ts.p.subGridModel[0].params) {
85
- for(j=0; j < ts.p.subGridModel[0].params.length; j++) {
86
- for(i=0; i<ts.p.colModel.length; i++) {
87
- if(ts.p.colModel[i].name == ts.p.subGridModel[0].params[j]) {
88
- dp[ts.p.colModel[i].name]= $("td:eq("+i+")",rd).text().replace(/\&#160\;/ig,'');
89
- }
90
- }
91
- }
92
- }
93
- if(!ts.grid.hDiv.loading) {
94
- ts.grid.hDiv.loading = true;
95
- $("#load_"+ts.p.id).show();
96
- if(!ts.p.subgridtype) { ts.p.subgridtype = ts.p.datatype; }
97
- if($.isFunction(ts.p.subgridtype)) {
98
- ts.p.subgridtype(dp);
99
- } else {
100
- ts.p.subgridtype = ts.p.subgridtype.toLowerCase();
101
- }
102
- switch(ts.p.subgridtype) {
103
- case "xml":
104
- case "json":
105
- $.ajax($.extend({
106
- type:ts.p.mtype,
107
- url: ts.p.subGridUrl,
108
- dataType:ts.p.subgridtype,
109
- data: $.isFunction(ts.p.serializeSubGridData)? ts.p.serializeSubGridData(dp) : dp,
110
- complete: function(sxml) {
111
- if(ts.p.subgridtype == "xml") {
112
- subGridXml(sxml.responseXML, sid);
113
- } else {
114
- subGridJson($.jgrid.parse(sxml.responseText),sid);
115
- }
116
- sxml=null;
117
- }
118
- }, $.jgrid.ajaxOptions, ts.p.ajaxSubgridOptions || {}));
119
- break;
120
- }
121
- }
122
- return false;
123
- };
124
- var subGridCell = function(trdiv,cell,pos){
125
- var tddiv = $("<td align='"+ts.p.subGridModel[0].align[pos]+"'></td>").html(cell);
126
- $(trdiv).append(tddiv);
127
- };
128
- var subGridXml = function(sjxml, sbid){
129
- var tddiv, i, cur, sgmap,
130
- dummy = $("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),
131
- trdiv = $("<tr></tr>");
132
- for (i = 0; i<ts.p.subGridModel[0].name.length; i++) {
133
- tddiv = $("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+ts.p.direction+"'></th>");
134
- $(tddiv).html(ts.p.subGridModel[0].name[i]);
135
- $(tddiv).width( ts.p.subGridModel[0].width[i]);
136
- $(trdiv).append(tddiv);
137
- }
138
- $(dummy).append(trdiv);
139
- if (sjxml){
140
- sgmap = ts.p.xmlReader.subgrid;
141
- $(sgmap.root+" "+sgmap.row, sjxml).each( function(){
142
- trdiv = $("<tr class='ui-widget-content ui-subtblcell'></tr>");
143
- if(sgmap.repeatitems === true) {
144
- $(sgmap.cell,this).each( function(i) {
145
- subGridCell(trdiv, $(this).text() || '&#160;',i);
146
- });
147
- } else {
148
- var f = ts.p.subGridModel[0].mapping || ts.p.subGridModel[0].name;
149
- if (f) {
150
- for (i=0;i<f.length;i++) {
151
- subGridCell(trdiv, $(f[i],this).text() || '&#160;',i);
152
- }
153
- }
154
- }
155
- $(dummy).append(trdiv);
156
- });
157
- }
158
- var pID = $("table:first",ts.grid.bDiv).attr("id")+"_";
159
- $("#"+pID+sbid).append(dummy);
160
- ts.grid.hDiv.loading = false;
161
- $("#load_"+ts.p.id).hide();
162
- return false;
163
- };
164
- var subGridJson = function(sjxml, sbid){
165
- var tddiv,result , i,cur, sgmap,j,
166
- dummy = $("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),
167
- trdiv = $("<tr></tr>");
168
- for (i = 0; i<ts.p.subGridModel[0].name.length; i++) {
169
- tddiv = $("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+ts.p.direction+"'></th>");
170
- $(tddiv).html(ts.p.subGridModel[0].name[i]);
171
- $(tddiv).width( ts.p.subGridModel[0].width[i]);
172
- $(trdiv).append(tddiv);
173
- }
174
- $(dummy).append(trdiv);
175
- if (sjxml){
176
- sgmap = ts.p.jsonReader.subgrid;
177
- result = sjxml[sgmap.root];
178
- if ( typeof result !== 'undefined' ) {
179
- for (i=0;i<result.length;i++) {
180
- cur = result[i];
181
- trdiv = $("<tr class='ui-widget-content ui-subtblcell'></tr>");
182
- if(sgmap.repeatitems === true) {
183
- if(sgmap.cell) { cur=cur[sgmap.cell]; }
184
- for (j=0;j<cur.length;j++) {
185
- subGridCell(trdiv, cur[j] || '&#160;',j);
186
- }
187
- } else {
188
- var f = ts.p.subGridModel[0].mapping || ts.p.subGridModel[0].name;
189
- if(f.length) {
190
- for (j=0;j<f.length;j++) {
191
- subGridCell(trdiv, cur[f[j]] || '&#160;',j);
192
- }
193
- }
194
- }
195
- $(dummy).append(trdiv);
196
- }
197
- }
198
- }
199
- var pID = $("table:first",ts.grid.bDiv).attr("id")+"_";
200
- $("#"+pID+sbid).append(dummy);
201
- ts.grid.hDiv.loading = false;
202
- $("#load_"+ts.p.id).hide();
203
- return false;
204
- };
205
- ts.subGridXml = function(xml,sid) {subGridXml(xml,sid);};
206
- ts.subGridJson = function(json,sid) {subGridJson(json,sid);};
207
- });
208
- },
209
- expandSubGridRow : function(rowid) {
210
- return this.each(function () {
211
- var $t = this;
212
- if(!$t.grid && !rowid) {return;}
213
- if($t.p.subGrid===true) {
214
- var rc = $(this).jqGrid("getInd",rowid,true);
215
- if(rc) {
216
- var sgc = $("td.sgcollapsed",rc)[0];
217
- if(sgc) {
218
- $(sgc).trigger("click");
219
- }
220
- }
221
- }
222
- });
223
- },
224
- collapseSubGridRow : function(rowid) {
225
- return this.each(function () {
226
- var $t = this;
227
- if(!$t.grid && !rowid) {return;}
228
- if($t.p.subGrid===true) {
229
- var rc = $(this).jqGrid("getInd",rowid,true);
230
- if(rc) {
231
- var sgc = $("td.sgexpanded",rc)[0];
232
- if(sgc) {
233
- $(sgc).trigger("click");
234
- }
235
- }
236
- }
237
- });
238
- },
239
- toggleSubGridRow : function(rowid) {
240
- return this.each(function () {
241
- var $t = this;
242
- if(!$t.grid && !rowid) {return;}
243
- if($t.p.subGrid===true) {
244
- var rc = $(this).jqGrid("getInd",rowid,true);
245
- if(rc) {
246
- var sgc = $("td.sgcollapsed",rc)[0];
247
- if(sgc) {
248
- $(sgc).trigger("click");
249
- } else {
250
- sgc = $("td.sgexpanded",rc)[0];
251
- if(sgc) {
252
- $(sgc).trigger("click");
253
- }
254
- }
255
- }
256
- }
257
- });
258
- }
259
- });
260
- })(jQuery);
1
+ ;(function($){
2
+ /**
3
+ * jqGrid extension for SubGrid Data
4
+ * Tony Tomov tony@trirand.com
5
+ * http://trirand.com/blog/
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl-2.0.html
9
+ **/
10
+ $.jgrid.extend({
11
+ setSubGrid : function () {
12
+ return this.each(function (){
13
+ var $t = this, cm;
14
+ $t.p.colNames.unshift("");
15
+ $t.p.colModel.unshift({name:'subgrid',width: $.browser.safari ? $t.p.subGridWidth+$t.p.cellLayout : $t.p.subGridWidth,sortable: false,resizable:false,hidedlg:true,search:false,fixed:true});
16
+ cm = $t.p.subGridModel;
17
+ if(cm[0]) {
18
+ cm[0].align = $.extend([],cm[0].align || []);
19
+ for(var i=0;i<cm[0].name.length;i++) { cm[0].align[i] = cm[0].align[i] || 'left';}
20
+ }
21
+ });
22
+ },
23
+ addSubGridCell :function (pos,iRow) {
24
+ var prp='',gv,sid;
25
+ this.each(function(){
26
+ prp = this.formatCol(pos,iRow);
27
+ gv = this.p.gridview;
28
+ sid= this.p.id;
29
+ });
30
+ if( gv === false ){
31
+ return "<td role=\"grid\" aria-describedby=\""+sid+"_subgrid\" class=\"ui-sgcollapsed sgcollapsed\" "+prp+"><a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a></td>";
32
+ } else {
33
+ return "<td role=\"grid\" aria-describedby=\""+sid+"_subgrid\" " +prp +"></td>";
34
+ }
35
+ },
36
+ addSubGrid : function(t,pos) {
37
+ return this.each(function(){
38
+ var ts = this;
39
+ if (!ts.grid ) { return; }
40
+ //-------------------------
41
+ var subGridCell = function(trdiv,cell,pos){
42
+ var tddiv = $("<td align='"+ts.p.subGridModel[0].align[pos]+"'></td>").html(cell);
43
+ $(trdiv).append(tddiv);
44
+ };
45
+ var subGridXml = function(sjxml, sbid){
46
+ var tddiv, i, sgmap,
47
+ dummy = $("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),
48
+ trdiv = $("<tr></tr>");
49
+ for (i = 0; i<ts.p.subGridModel[0].name.length; i++) {
50
+ tddiv = $("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+ts.p.direction+"'></th>");
51
+ $(tddiv).html(ts.p.subGridModel[0].name[i]);
52
+ $(tddiv).width( ts.p.subGridModel[0].width[i]);
53
+ $(trdiv).append(tddiv);
54
+ }
55
+ $(dummy).append(trdiv);
56
+ if (sjxml){
57
+ sgmap = ts.p.xmlReader.subgrid;
58
+ $(sgmap.root+" "+sgmap.row, sjxml).each( function(){
59
+ trdiv = $("<tr class='ui-widget-content ui-subtblcell'></tr>");
60
+ if(sgmap.repeatitems === true) {
61
+ $(sgmap.cell,this).each( function(i) {
62
+ subGridCell(trdiv, $(this).text() || '&#160;',i);
63
+ });
64
+ } else {
65
+ var f = ts.p.subGridModel[0].mapping || ts.p.subGridModel[0].name;
66
+ if (f) {
67
+ for (i=0;i<f.length;i++) {
68
+ subGridCell(trdiv, $(f[i],this).text() || '&#160;',i);
69
+ }
70
+ }
71
+ }
72
+ $(dummy).append(trdiv);
73
+ });
74
+ }
75
+ var pID = $("table:first",ts.grid.bDiv).attr("id")+"_";
76
+ $("#"+pID+sbid).append(dummy);
77
+ ts.grid.hDiv.loading = false;
78
+ $("#load_"+ts.p.id).hide();
79
+ return false;
80
+ };
81
+ var subGridJson = function(sjxml, sbid){
82
+ var tddiv,result , i,cur, sgmap,j,
83
+ dummy = $("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"),
84
+ trdiv = $("<tr></tr>");
85
+ for (i = 0; i<ts.p.subGridModel[0].name.length; i++) {
86
+ tddiv = $("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+ts.p.direction+"'></th>");
87
+ $(tddiv).html(ts.p.subGridModel[0].name[i]);
88
+ $(tddiv).width( ts.p.subGridModel[0].width[i]);
89
+ $(trdiv).append(tddiv);
90
+ }
91
+ $(dummy).append(trdiv);
92
+ if (sjxml){
93
+ sgmap = ts.p.jsonReader.subgrid;
94
+ result = sjxml[sgmap.root];
95
+ if ( typeof result !== 'undefined' ) {
96
+ for (i=0;i<result.length;i++) {
97
+ cur = result[i];
98
+ trdiv = $("<tr class='ui-widget-content ui-subtblcell'></tr>");
99
+ if(sgmap.repeatitems === true) {
100
+ if(sgmap.cell) { cur=cur[sgmap.cell]; }
101
+ for (j=0;j<cur.length;j++) {
102
+ subGridCell(trdiv, cur[j] || '&#160;',j);
103
+ }
104
+ } else {
105
+ var f = ts.p.subGridModel[0].mapping || ts.p.subGridModel[0].name;
106
+ if(f.length) {
107
+ for (j=0;j<f.length;j++) {
108
+ subGridCell(trdiv, cur[f[j]] || '&#160;',j);
109
+ }
110
+ }
111
+ }
112
+ $(dummy).append(trdiv);
113
+ }
114
+ }
115
+ }
116
+ var pID = $("table:first",ts.grid.bDiv).attr("id")+"_";
117
+ $("#"+pID+sbid).append(dummy);
118
+ ts.grid.hDiv.loading = false;
119
+ $("#load_"+ts.p.id).hide();
120
+ return false;
121
+ };
122
+ var populatesubgrid = function( rd ) {
123
+ var sid,dp, i, j;
124
+ sid = $(rd).attr("id");
125
+ dp = {nd_: (new Date().getTime())};
126
+ dp[ts.p.prmNames.subgridid]=sid;
127
+ if(!ts.p.subGridModel[0]) { return false; }
128
+ if(ts.p.subGridModel[0].params) {
129
+ for(j=0; j < ts.p.subGridModel[0].params.length; j++) {
130
+ for(i=0; i<ts.p.colModel.length; i++) {
131
+ if(ts.p.colModel[i].name == ts.p.subGridModel[0].params[j]) {
132
+ dp[ts.p.colModel[i].name]= $("td:eq("+i+")",rd).text().replace(/\&#160\;/ig,'');
133
+ }
134
+ }
135
+ }
136
+ }
137
+ if(!ts.grid.hDiv.loading) {
138
+ ts.grid.hDiv.loading = true;
139
+ $("#load_"+ts.p.id).show();
140
+ if(!ts.p.subgridtype) { ts.p.subgridtype = ts.p.datatype; }
141
+ if($.isFunction(ts.p.subgridtype)) {
142
+ ts.p.subgridtype.call(ts, dp);
143
+ } else {
144
+ ts.p.subgridtype = ts.p.subgridtype.toLowerCase();
145
+ }
146
+ switch(ts.p.subgridtype) {
147
+ case "xml":
148
+ case "json":
149
+ $.ajax($.extend({
150
+ type:ts.p.mtype,
151
+ url: ts.p.subGridUrl,
152
+ dataType:ts.p.subgridtype,
153
+ data: $.isFunction(ts.p.serializeSubGridData)? ts.p.serializeSubGridData.call(ts, dp) : dp,
154
+ complete: function(sxml) {
155
+ if(ts.p.subgridtype == "xml") {
156
+ subGridXml(sxml.responseXML, sid);
157
+ } else {
158
+ subGridJson($.jgrid.parse(sxml.responseText),sid);
159
+ }
160
+ sxml=null;
161
+ }
162
+ }, $.jgrid.ajaxOptions, ts.p.ajaxSubgridOptions || {}));
163
+ break;
164
+ }
165
+ }
166
+ return false;
167
+ };
168
+ var res,_id, pID,atd, nhc, subdata, bfsc;
169
+ $("td:eq("+pos+")",t).click( function(e) {
170
+ if($(this).hasClass("sgcollapsed")) {
171
+ pID = ts.p.id;
172
+ res = $(this).parent();
173
+ atd = pos >=1 ? "<td colspan='"+pos+"'>&#160;</td>":"";
174
+ _id = $(res).attr("id");
175
+ bfsc =true;
176
+ if($.isFunction(ts.p.subGridBeforeExpand)) {
177
+ bfsc = ts.p.subGridBeforeExpand.call(ts, pID+"_"+_id,_id);
178
+ }
179
+ if(bfsc === false) {return false;}
180
+ nhc = 0;
181
+ $.each(ts.p.colModel,function(i,v){
182
+ if(this.hidden === true || this.name == 'rn' || this.name == 'cb') {nhc++;}
183
+ });
184
+ subdata = "<tr role='row' class='ui-subgrid'>"+atd+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon ui-icon-carat-1-sw'/></td><td colspan='"+parseInt(ts.p.colNames.length-1-nhc,10)+"' class='ui-widget-content subgrid-data'><div id="+pID+"_"+_id+" class='tablediv'>";
185
+ $(this).parent().after( subdata+ "</div></td></tr>" );
186
+ if( $.isFunction(ts.p.subGridRowExpanded)) {
187
+ ts.p.subGridRowExpanded.call(ts, pID+"_"+ _id,_id);
188
+ } else {
189
+ populatesubgrid(res);
190
+ }
191
+ $(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-minus'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded");
192
+ } else if($(this).hasClass("sgexpanded")) {
193
+ bfsc = true;
194
+ if( $.isFunction(ts.p.subGridRowColapsed)) {
195
+ res = $(this).parent();
196
+ _id = $(res).attr("id");
197
+ bfsc = ts.p.subGridRowColapsed.call(ts, pID+"_"+_id,_id );
198
+ }
199
+ if(bfsc===false) {return false;}
200
+ $(this).parent().next().remove(".ui-subgrid");
201
+ $(this).html("<a href='javascript:void(0);'><span class='ui-icon ui-icon-plus'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed");
202
+ }
203
+ return false;
204
+ });
205
+ ts.subGridXml = function(xml,sid) {subGridXml(xml,sid);};
206
+ ts.subGridJson = function(json,sid) {subGridJson(json,sid);};
207
+ });
208
+ },
209
+ expandSubGridRow : function(rowid) {
210
+ return this.each(function () {
211
+ var $t = this;
212
+ if(!$t.grid && !rowid) {return;}
213
+ if($t.p.subGrid===true) {
214
+ var rc = $(this).jqGrid("getInd",rowid,true);
215
+ if(rc) {
216
+ var sgc = $("td.sgcollapsed",rc)[0];
217
+ if(sgc) {
218
+ $(sgc).trigger("click");
219
+ }
220
+ }
221
+ }
222
+ });
223
+ },
224
+ collapseSubGridRow : function(rowid) {
225
+ return this.each(function () {
226
+ var $t = this;
227
+ if(!$t.grid && !rowid) {return;}
228
+ if($t.p.subGrid===true) {
229
+ var rc = $(this).jqGrid("getInd",rowid,true);
230
+ if(rc) {
231
+ var sgc = $("td.sgexpanded",rc)[0];
232
+ if(sgc) {
233
+ $(sgc).trigger("click");
234
+ }
235
+ }
236
+ }
237
+ });
238
+ },
239
+ toggleSubGridRow : function(rowid) {
240
+ return this.each(function () {
241
+ var $t = this;
242
+ if(!$t.grid && !rowid) {return;}
243
+ if($t.p.subGrid===true) {
244
+ var rc = $(this).jqGrid("getInd",rowid,true);
245
+ if(rc) {
246
+ var sgc = $("td.sgcollapsed",rc)[0];
247
+ if(sgc) {
248
+ $(sgc).trigger("click");
249
+ } else {
250
+ sgc = $("td.sgexpanded",rc)[0];
251
+ if(sgc) {
252
+ $(sgc).trigger("click");
253
+ }
254
+ }
255
+ }
256
+ }
257
+ });
258
+ }
259
+ });
260
+ })(jQuery);