jqgrid-jquery-rails 4.5.0.0 → 4.5.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,128 +1,128 @@
1
- ;(function($){
2
- /**
3
- * jqGrid Thai Translation
4
- * Kittituch Manakul m.kittituch@Gmail.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.html
9
- **/
10
- $.jgrid = $.jgrid || {};
11
- $.extend($.jgrid,{
12
- defaults : {
13
- recordtext: "แสดง {0} - {1} จาก {2}",
14
- emptyrecords: "ไม่พบข้อมูล",
15
- loadtext: "กำลังร้องขอข้อมูล...",
16
- pgtext : "หน้า {0} จาก {1}"
17
- },
18
- search : {
19
- caption: "กำลังค้นหา...",
20
- Find: "ค้นหา",
21
- Reset: "คืนค่ากลับ",
22
- odata: [{ oper:'eq', text:"เท่ากับ"},{ oper:'ne', text:"ไม่เท่ากับ"},{ oper:'lt', text:"น้อยกว่า"},{ oper:'le', text:"ไม่มากกว่า"},{ oper:'gt', text:"มากกกว่า"},{ oper:'ge', text:"ไม่น้อยกว่า"},{ oper:'bw', text:"ขึ้นต้นด้วย"},{ oper:'bn', text:"ไม่ขึ้นต้นด้วย"},{ oper:'in', text:"มีคำใดคำหนึ่งใน"},{ oper:'ni', text:"ไม่มีคำใดคำหนึ่งใน"},{ oper:'ew', text:"ลงท้ายด้วย"},{ oper:'en', text:"ไม่ลงท้ายด้วย"},{ oper:'cn', text:"มีคำว่า"},{ oper:'nc', text:"ไม่มีคำว่า"}],
23
- groupOps: [ { op: "และ", text: "ทั้งหมด" }, { op: "หรือ", text: "ใดๆ" } ]
24
- },
25
- edit : {
26
- addCaption: "เพิ่มข้อมูล",
27
- editCaption: "แก้ไขข้อมูล",
28
- bSubmit: "บันทึก",
29
- bCancel: "ยกเลิก",
30
- bClose: "ปิด",
31
- saveData: "คุณต้องการบันทึการแก้ไข ใช่หรือไม่?",
32
- bYes : "บันทึก",
33
- bNo : "ละทิ้งการแก้ไข",
34
- bExit : "ยกเลิก",
35
- msg: {
36
- required:"ข้อมูลนี้จำเป็น",
37
- number:"กรุณากรอกหมายเลขให้ถูกต้อง",
38
- minValue:"ค่าของข้อมูลนี้ต้องไม่น้อยกว่า",
39
- maxValue:"ค่าของข้อมูลนี้ต้องไม่มากกว่า",
40
- email: "อีเมลล์นี้ไม่ถูกต้อง",
41
- integer: "กรุณากรอกเป็นจำนวนเต็ม",
42
- date: "กรุณากรอกวันที่ให้ถูกต้อง",
43
- url: "URL ไม่ถูกต้อง URL จำเป็นต้องขึ้นต้นด้วย 'http://' หรือ 'https://'",
44
- nodefined : "ไม่ได้ถูกกำหนดค่า!",
45
- novalue : "ต้องการการคืนค่า!",
46
- customarray : "ฟังก์ชันที่สร้างขึ้นต้องส่งค่ากลับเป็นแบบแอเรย์",
47
- customfcheck : "ระบบต้องการฟังก์ชันที่สร้างขึ้นสำหรับการตรวจสอบ!"
48
-
49
- }
50
- },
51
- view : {
52
- caption: "เรียกดูข้อมูล",
53
- bClose: "ปิด"
54
- },
55
- del : {
56
- caption: "ลบข้อมูล",
57
- msg: "คุณต้องการลบข้อมูลที่ถูกเลือก ใช่หรือไม่?",
58
- bSubmit: "ต้องการลบ",
59
- bCancel: "ยกเลิก"
60
- },
61
- nav : {
62
- edittext: "",
63
- edittitle: "แก้ไขข้อมูล",
64
- addtext:"",
65
- addtitle: "เพิ่มข้อมูล",
66
- deltext: "",
67
- deltitle: "ลบข้อมูล",
68
- searchtext: "",
69
- searchtitle: "ค้นหาข้อมูล",
70
- refreshtext: "",
71
- refreshtitle: "รีเฟรช",
72
- alertcap: "คำเตือน",
73
- alerttext: "กรุณาเลือกข้อมูล",
74
- viewtext: "",
75
- viewtitle: "ดูรายละเอียดข้อมูล"
76
- },
77
- col : {
78
- caption: "กรุณาเลือกคอลัมน์",
79
- bSubmit: "ตกลง",
80
- bCancel: "ยกเลิก"
81
- },
82
- errors : {
83
- errcap : "เกิดความผิดพลาด",
84
- nourl : "ไม่ได้กำหนด URL",
85
- norecords: "ไม่มีข้อมูลให้ดำเนินการ",
86
- model : "จำนวนคอลัมน์ไม่เท่ากับจำนวนคอลัมน์โมเดล!"
87
- },
88
- formatter : {
89
- integer : {thousandsSeparator: " ", defaultValue: '0'},
90
- number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
91
- currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
92
- date : {
93
- dayNames: [
94
- "อา", "จ", "อ", "พ", "พฤ", "ศ", "ส",
95
- "อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัสบดี", "ศูกร์", "เสาร์"
96
- ],
97
- monthNames: [
98
- "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.",
99
- "มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฏาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"
100
- ],
101
- AmPm : ["am","pm","AM","PM"],
102
- S: function (j) {return ''},
103
- srcformat: 'Y-m-d',
104
- newformat: 'd/m/Y',
105
- parseRe : /[Tt\\\/:_;.,\t\s-]/,
106
- masks : {
107
- ISO8601Long:"Y-m-d H:i:s",
108
- ISO8601Short:"Y-m-d",
109
- ShortDate: "n/j/Y",
110
- LongDate: "l, F d, Y",
111
- FullDateTime: "l, F d, Y g:i:s A",
112
- MonthDay: "F d",
113
- ShortTime: "g:i A",
114
- LongTime: "g:i:s A",
115
- SortableDateTime: "Y-m-d\\TH:i:s",
116
- UniversalSortableDateTime: "Y-m-d H:i:sO",
117
- YearMonth: "F, Y"
118
- },
119
- reformatAfterEdit : false
120
- },
121
- baseLinkUrl: '',
122
- showAction: '',
123
- target: '',
124
- checkbox : {disabled:true},
125
- idName : 'id'
126
- }
127
- });
128
- })(jQuery);
1
+ ;(function($){
2
+ /**
3
+ * jqGrid Thai Translation
4
+ * Kittituch Manakul m.kittituch@Gmail.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.html
9
+ **/
10
+ $.jgrid = $.jgrid || {};
11
+ $.extend($.jgrid,{
12
+ defaults : {
13
+ recordtext: "แสดง {0} - {1} จาก {2}",
14
+ emptyrecords: "ไม่พบข้อมูล",
15
+ loadtext: "กำลังร้องขอข้อมูล...",
16
+ pgtext : "หน้า {0} จาก {1}"
17
+ },
18
+ search : {
19
+ caption: "กำลังค้นหา...",
20
+ Find: "ค้นหา",
21
+ Reset: "คืนค่ากลับ",
22
+ odata: [{ oper:'eq', text:"เท่ากับ"},{ oper:'ne', text:"ไม่เท่ากับ"},{ oper:'lt', text:"น้อยกว่า"},{ oper:'le', text:"ไม่มากกว่า"},{ oper:'gt', text:"มากกกว่า"},{ oper:'ge', text:"ไม่น้อยกว่า"},{ oper:'bw', text:"ขึ้นต้นด้วย"},{ oper:'bn', text:"ไม่ขึ้นต้นด้วย"},{ oper:'in', text:"มีคำใดคำหนึ่งใน"},{ oper:'ni', text:"ไม่มีคำใดคำหนึ่งใน"},{ oper:'ew', text:"ลงท้ายด้วย"},{ oper:'en', text:"ไม่ลงท้ายด้วย"},{ oper:'cn', text:"มีคำว่า"},{ oper:'nc', text:"ไม่มีคำว่า"}],
23
+ groupOps: [ { op: "และ", text: "ทั้งหมด" }, { op: "หรือ", text: "ใดๆ" } ]
24
+ },
25
+ edit : {
26
+ addCaption: "เพิ่มข้อมูล",
27
+ editCaption: "แก้ไขข้อมูล",
28
+ bSubmit: "บันทึก",
29
+ bCancel: "ยกเลิก",
30
+ bClose: "ปิด",
31
+ saveData: "คุณต้องการบันทึการแก้ไข ใช่หรือไม่?",
32
+ bYes : "บันทึก",
33
+ bNo : "ละทิ้งการแก้ไข",
34
+ bExit : "ยกเลิก",
35
+ msg: {
36
+ required:"ข้อมูลนี้จำเป็น",
37
+ number:"กรุณากรอกหมายเลขให้ถูกต้อง",
38
+ minValue:"ค่าของข้อมูลนี้ต้องไม่น้อยกว่า",
39
+ maxValue:"ค่าของข้อมูลนี้ต้องไม่มากกว่า",
40
+ email: "อีเมลล์นี้ไม่ถูกต้อง",
41
+ integer: "กรุณากรอกเป็นจำนวนเต็ม",
42
+ date: "กรุณากรอกวันที่ให้ถูกต้อง",
43
+ url: "URL ไม่ถูกต้อง URL จำเป็นต้องขึ้นต้นด้วย 'http://' หรือ 'https://'",
44
+ nodefined : "ไม่ได้ถูกกำหนดค่า!",
45
+ novalue : "ต้องการการคืนค่า!",
46
+ customarray : "ฟังก์ชันที่สร้างขึ้นต้องส่งค่ากลับเป็นแบบแอเรย์",
47
+ customfcheck : "ระบบต้องการฟังก์ชันที่สร้างขึ้นสำหรับการตรวจสอบ!"
48
+
49
+ }
50
+ },
51
+ view : {
52
+ caption: "เรียกดูข้อมูล",
53
+ bClose: "ปิด"
54
+ },
55
+ del : {
56
+ caption: "ลบข้อมูล",
57
+ msg: "คุณต้องการลบข้อมูลที่ถูกเลือก ใช่หรือไม่?",
58
+ bSubmit: "ต้องการลบ",
59
+ bCancel: "ยกเลิก"
60
+ },
61
+ nav : {
62
+ edittext: "",
63
+ edittitle: "แก้ไขข้อมูล",
64
+ addtext:"",
65
+ addtitle: "เพิ่มข้อมูล",
66
+ deltext: "",
67
+ deltitle: "ลบข้อมูล",
68
+ searchtext: "",
69
+ searchtitle: "ค้นหาข้อมูล",
70
+ refreshtext: "",
71
+ refreshtitle: "รีเฟรช",
72
+ alertcap: "คำเตือน",
73
+ alerttext: "กรุณาเลือกข้อมูล",
74
+ viewtext: "",
75
+ viewtitle: "ดูรายละเอียดข้อมูล"
76
+ },
77
+ col : {
78
+ caption: "กรุณาเลือกคอลัมน์",
79
+ bSubmit: "ตกลง",
80
+ bCancel: "ยกเลิก"
81
+ },
82
+ errors : {
83
+ errcap : "เกิดความผิดพลาด",
84
+ nourl : "ไม่ได้กำหนด URL",
85
+ norecords: "ไม่มีข้อมูลให้ดำเนินการ",
86
+ model : "จำนวนคอลัมน์ไม่เท่ากับจำนวนคอลัมน์โมเดล!"
87
+ },
88
+ formatter : {
89
+ integer : {thousandsSeparator: " ", defaultValue: '0'},
90
+ number : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.00'},
91
+ currency : {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
92
+ date : {
93
+ dayNames: [
94
+ "อา", "จ", "อ", "พ", "พฤ", "ศ", "ส",
95
+ "อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัสบดี", "ศูกร์", "เสาร์"
96
+ ],
97
+ monthNames: [
98
+ "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค.",
99
+ "มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฏาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"
100
+ ],
101
+ AmPm : ["am","pm","AM","PM"],
102
+ S: function (j) {return ''},
103
+ srcformat: 'Y-m-d',
104
+ newformat: 'd/m/Y',
105
+ parseRe : /[Tt\\\/:_;.,\t\s-]/,
106
+ masks : {
107
+ ISO8601Long:"Y-m-d H:i:s",
108
+ ISO8601Short:"Y-m-d",
109
+ ShortDate: "n/j/Y",
110
+ LongDate: "l, F d, Y",
111
+ FullDateTime: "l, F d, Y g:i:s A",
112
+ MonthDay: "F d",
113
+ ShortTime: "g:i A",
114
+ LongTime: "g:i:s A",
115
+ SortableDateTime: "Y-m-d\\TH:i:s",
116
+ UniversalSortableDateTime: "Y-m-d H:i:sO",
117
+ YearMonth: "F, Y"
118
+ },
119
+ reformatAfterEdit : false
120
+ },
121
+ baseLinkUrl: '',
122
+ showAction: '',
123
+ target: '',
124
+ checkbox : {disabled:true},
125
+ idName : 'id'
126
+ }
127
+ });
128
+ })(jQuery);
@@ -2,12 +2,12 @@
2
2
  // @compilation_level SIMPLE_OPTIMIZATIONS
3
3
 
4
4
  /**
5
- * @license jqGrid 4.5.0 - jQuery Grid
5
+ * @license jqGrid 4.5.1 - jQuery Grid
6
6
  * Copyright (c) 2008, Tony Tomov, tony@trirand.com
7
7
  * Dual licensed under the MIT and GPL licenses
8
8
  * http://www.opensource.org/licenses/mit-license.php
9
9
  * http://www.gnu.org/licenses/gpl-2.0.html
10
- * Date: 2013-05-13
10
+ * Date: 2013-05-21
11
11
  */
12
12
  //jsHint options
13
13
  /*jshint evil:true, eqeqeq:false, eqnull:true, devel:true */
@@ -17,7 +17,7 @@
17
17
  "use strict";
18
18
  $.jgrid = $.jgrid || {};
19
19
  $.extend($.jgrid,{
20
- version : "4.5.0",
20
+ version : "4.5.1.0",
21
21
  htmlDecode : function(value){
22
22
  if(value && (value===' ' || value===' ' || (value.length===1 && value.charCodeAt(0)===160))) { return "";}
23
23
  return !value ? value : String(value).replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&quot;/g, '"').replace(/&amp;/g, "&");
@@ -127,7 +127,7 @@ $.extend($.jgrid,{
127
127
  if(dM !== -1 && dM < 12){date[k] = dM+1; ts.m = date[k];}
128
128
  }
129
129
  if(format[k] === 'F') {
130
- dM = $.inArray(date[k],opts.monthNames);
130
+ dM = $.inArray(date[k],opts.monthNames,12);
131
131
  if(dM !== -1 && dM > 11){date[k] = dM+1-12; ts.m = date[k];}
132
132
  }
133
133
  if(format[k] === 'a') {
@@ -2144,8 +2144,9 @@ $.fn.jqGrid = function( pin ) {
2144
2144
  });
2145
2145
  }
2146
2146
  },
2147
- multiSort = function(iCol, reload, sorder) {
2148
- var splas, sort="", cm = ts.p.colModel, fs=false, ls, selTh = ts.grid.headers[iCol].el, so="";
2147
+ multiSort = function(iCol, obj ) {
2148
+ var splas, sort="", cm = ts.p.colModel, fs=false, ls,
2149
+ selTh = ts.p.frozenColumns ? obj : ts.grid.headers[iCol].el, so="";
2149
2150
  $("span.ui-grid-ico-sort",selTh).addClass('ui-state-disabled');
2150
2151
  $(selTh).attr("aria-selected","false");
2151
2152
 
@@ -2188,7 +2189,7 @@ $.fn.jqGrid = function( pin ) {
2188
2189
  sort = sort.substring(0, ls);
2189
2190
  ts.p.sortname = sort;
2190
2191
  },
2191
- sortData = function (index, idxcol,reload,sor){
2192
+ sortData = function (index, idxcol,reload,sor, obj){
2192
2193
  if(!ts.p.colModel[idxcol].sortable) { return; }
2193
2194
  var so;
2194
2195
  if(ts.p.savedRow.length > 0) {return;}
@@ -2201,20 +2202,27 @@ $.fn.jqGrid = function( pin ) {
2201
2202
  ts.p.page = 1;
2202
2203
  }
2203
2204
  if(ts.p.multiSort) {
2204
- multiSort( idxcol, reload, so);
2205
+ multiSort( idxcol, obj);
2205
2206
  } else {
2206
2207
  if(sor) {
2207
2208
  if(ts.p.lastsort === idxcol && ts.p.sortorder === sor && !reload) { return; }
2208
2209
  ts.p.sortorder = sor;
2209
2210
  }
2210
- var previousSelectedTh = ts.grid.headers[ts.p.lastsort].el, newSelectedTh = ts.grid.headers[idxcol].el;
2211
+ var previousSelectedTh = ts.grid.headers[ts.p.lastsort].el, newSelectedTh = ts.p.frozenColumns ? obj : ts.grid.headers[idxcol].el;
2211
2212
 
2212
2213
  $("span.ui-grid-ico-sort",previousSelectedTh).addClass('ui-state-disabled');
2213
2214
  $(previousSelectedTh).attr("aria-selected","false");
2215
+ if(ts.p.frozenColumns) {
2216
+ ts.grid.fhDiv.find("span.ui-grid-ico-sort").addClass('ui-state-disabled');
2217
+ ts.grid.fhDiv.find("th").attr("aria-selected","false");
2218
+ }
2214
2219
  $("span.ui-icon-"+ts.p.sortorder,newSelectedTh).removeClass('ui-state-disabled');
2215
2220
  $(newSelectedTh).attr("aria-selected","true");
2216
2221
  if(!ts.p.viewsortcols[0]) {
2217
2222
  if(ts.p.lastsort !== idxcol) {
2223
+ if(ts.p.frozenColumns){
2224
+ ts.grid.fhDiv.find("span.s-ico").hide();
2225
+ }
2218
2226
  $("span.s-ico",previousSelectedTh).hide();
2219
2227
  $("span.s-ico",newSelectedTh).show();
2220
2228
  }
@@ -2571,9 +2579,21 @@ $.fn.jqGrid = function( pin ) {
2571
2579
  if (!ts.p.viewsortcols[2]) { s = "th>div>span>span.ui-grid-ico-sort"; }
2572
2580
  var t = $(e.target).closest(s);
2573
2581
  if (t.length !== 1) { return; }
2574
- var ci = getColumnHeaderIndex(this);
2582
+ var ci;
2583
+ if(ts.p.frozenColumns) {
2584
+ var tid = $(this)[0].id.substring(5);
2585
+ $(ts.p.colModel).each(function(i){
2586
+ if (this.name === tid) {
2587
+ ci = i;return false;
2588
+ }
2589
+ });
2590
+ } else {
2591
+ ci = getColumnHeaderIndex(this);
2592
+ }
2575
2593
  if (!ts.p.viewsortcols[2]) { r=true;d=t.attr("sort"); }
2576
- sortData( $('div',this)[0].id, ci, r, d);
2594
+ if(ci != null){
2595
+ sortData( $('div',this)[0].id, ci, r, d, this);
2596
+ }
2577
2597
  return false;
2578
2598
  });
2579
2599
  if (ts.p.sortable && $.fn.sortable) {
@@ -5287,10 +5307,17 @@ $.jgrid.extend({
5287
5307
  top=parseInt(top,10) + 18;
5288
5308
 
5289
5309
  var fs = $('.ui-jqgrid-view').css('font-size') || '11px';
5290
- var str = '<ul id="sopt_menu" class="ui-search-menu" role="menu" tabindex="0" style="font-size:'+fs+';left:'+left+'px;top:'+top+'px;">',
5291
- cm = $t.p.colModel[parseInt( $(elem).attr("colindex") )],
5310
+ var str = '<ul id="sopt_menu" class="ui-search-menu" role="menu" tabindex="0" style="font-size:'+fs+';left:'+left+'px;top:'+top+'px;">',
5292
5311
  selected = $(elem).attr("soper"), selclass,
5293
- aoprs = [], i, ina, options = $.extend({}, cm.searchoptions);
5312
+ aoprs = [], i, ina;
5313
+ var i=0, nm =$(elem).attr("colname"),len = $t.p.colModel.length;
5314
+ while(i<len) {
5315
+ if($t.p.colModel[i].name === nm) {
5316
+ break;
5317
+ }
5318
+ i++;
5319
+ }
5320
+ var cm = $t.p.colModel[i], options = $.extend({}, cm.searchoptions);
5294
5321
  if(!options.sopt) {
5295
5322
  options.sopt = [];
5296
5323
  options.sopt[0]= cm.stype==='select' ? 'eq' : p.defaultSearch;
@@ -5300,7 +5327,7 @@ $.jgrid.extend({
5300
5327
  ina = $.inArray(options.sopt[i],aoprs);
5301
5328
  if(ina !== -1) {
5302
5329
  selclass = selected === p.odata[ina].oper ? "ui-state-highlight" : "";
5303
- str += '<li class="ui-menu-item '+selclass+'" role="presentation"><a href="#" class="ui-corner-all g-menu-item" tabindex="0" role="menuitem" value="'+p.odata[ina].oper+'" oper="'+p.operands[p.odata[ina].oper]+'"><table cellspacing="0" cellpadding="0" border="0"><tr><td width="25px">'+p.operands[p.odata[ina].oper]+'</td><td>'+ p.odata[ina].text+'</td></tr></table></a></li>';
5330
+ str += '<li class="ui-menu-item '+selclass+'" role="presentation"><a class="ui-corner-all g-menu-item" tabindex="0" role="menuitem" value="'+p.odata[ina].oper+'" oper="'+p.operands[p.odata[ina].oper]+'"><table cellspacing="0" cellpadding="0" border="0"><tr><td width="25px">'+p.operands[p.odata[ina].oper]+'</td><td>'+ p.odata[ina].text+'</td></tr></table></a></li>';
5304
5331
  }
5305
5332
  }
5306
5333
  str += "</ul>";
@@ -5326,7 +5353,7 @@ $.jgrid.extend({
5326
5353
  // create the row
5327
5354
  var tr = $("<tr class='ui-search-toolbar' role='rowheader'></tr>");
5328
5355
  var timeoutHnd;
5329
- $.each($t.p.colModel,function(colindex){
5356
+ $.each($t.p.colModel,function(){
5330
5357
  var cm=this, soptions, surl, self, select = "", sot="=", so,
5331
5358
  th = $("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+$t.p.direction+"'></th>"),
5332
5359
  thd = $("<div style='position:relative;height:100%;padding-right:0.3em;padding-left:0.3em;'></div>"),
@@ -5345,7 +5372,7 @@ $.jgrid.extend({
5345
5372
  }
5346
5373
  }
5347
5374
  var st = soptions.searchtitle != null ? soptions.searchtitle : p.operandTitle;
5348
- select = "<a href='#' title='"+st+"' style='padding-right: 0.5em;' soper='"+so+"' class='soptclass' colindex='"+colindex+"'>"+sot+"</a>";
5375
+ select = "<a title='"+st+"' style='padding-right: 0.5em;' soper='"+so+"' class='soptclass' colname='"+this.name+"'>"+sot+"</a>";
5349
5376
  }
5350
5377
  $("td:eq(0)",stbl).append(select);
5351
5378
  switch (this.stype)
@@ -5508,6 +5535,12 @@ $.jgrid.extend({
5508
5535
  left = ( offset.left ),
5509
5536
  top = ( offset.top);
5510
5537
  buildRuleMenu(this, left, top );
5538
+ e.stopPropagation();
5539
+ });
5540
+ $("body").on('click', function(e){
5541
+ if(e.target.className !== "soptclass") {
5542
+ $("#sopt_menu").hide();
5543
+ }
5511
5544
  });
5512
5545
  }
5513
5546
  this.ftoolbar = true;
@@ -5751,9 +5784,14 @@ $.jgrid.extend({
5751
5784
  $("tr.jqg-first-row-header, tr.jqg-third-row-header", htbl).each(function(){
5752
5785
  $("th:gt("+maxfrozen+")",this).remove();
5753
5786
  });
5754
- var swapfroz = -1, fdel = -1;
5787
+ var swapfroz = -1, fdel = -1, cs, rs;
5755
5788
  $("tr.jqg-second-row-header th", htbl).each(function(){
5756
- var cs= parseInt($(this).attr("colspan"),10);
5789
+ cs= parseInt($(this).attr("colspan"),10);
5790
+ rs= parseInt($(this).attr("rowspan"),10);
5791
+ if(rs) {
5792
+ swapfroz++;
5793
+ fdel++;
5794
+ }
5757
5795
  if(cs) {
5758
5796
  swapfroz = swapfroz+cs;
5759
5797
  fdel++;
@@ -7336,14 +7374,14 @@ $.jgrid.extend({
7336
7374
  } else {
7337
7375
  $($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
7338
7376
  }
7339
- if(rp_ge[$t.p.id].closeAfterAdd) {
7340
- if($t.p.treeGrid !== true){
7341
- $($t).jqGrid("setSelection",ret[2]);
7342
- }
7343
- $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
7344
- } else if (rp_ge[$t.p.id].clearAfterAdd) {
7345
- fillData("_empty",$t,frmgr);
7377
+ }
7378
+ if(rp_ge[$t.p.id].closeAfterAdd) {
7379
+ if($t.p.treeGrid !== true){
7380
+ $($t).jqGrid("setSelection",ret[2]);
7346
7381
  }
7382
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
7383
+ } else if (rp_ge[$t.p.id].clearAfterAdd) {
7384
+ fillData("_empty",$t,frmgr);
7347
7385
  }
7348
7386
  } else {
7349
7387
  // the action is update
@@ -7369,7 +7407,7 @@ $.jgrid.extend({
7369
7407
  }
7370
7408
  if(rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {
7371
7409
  $("#"+frmgr).data("disabled",false);
7372
- if(rp_ge[$t.p.id]._savedData[$t.p.id+"_id"] !="_empty"){
7410
+ if(rp_ge[$t.p.id]._savedData[$t.p.id+"_id"] !== "_empty"){
7373
7411
  for(key in rp_ge[$t.p.id]._savedData) {
7374
7412
  if(rp_ge[$t.p.id]._savedData.hasOwnProperty(key) && postdata[key]) {
7375
7413
  rp_ge[$t.p.id]._savedData[key] = postdata[key];
@@ -7401,10 +7439,10 @@ $.jgrid.extend({
7401
7439
  ret[0] = false;
7402
7440
  ret[1] = dpret[1] || "Error deleting the selected row!" ;
7403
7441
  } else {
7404
- if(ajaxOptions.data.oper == opers.addoper && rp_ge[$t.p.id].closeAfterAdd ) {
7442
+ if(ajaxOptions.data.oper === opers.addoper && rp_ge[$t.p.id].closeAfterAdd ) {
7405
7443
  $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
7406
7444
  }
7407
- if(ajaxOptions.data.oper == opers.editoper && rp_ge[$t.p.id].closeAfterEdit ) {
7445
+ if(ajaxOptions.data.oper === opers.editoper && rp_ge[$t.p.id].closeAfterEdit ) {
7408
7446
  $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
7409
7447
  }
7410
7448
  }
@@ -9577,7 +9615,7 @@ $.jgrid.extend({
9577
9615
  }
9578
9616
  if(tmp) {
9579
9617
  tmp[opers.oper] = opers.editoper;
9580
- if (tmp[idname] === undefined) {
9618
+ if (tmp[idname] === undefined || tmp[idname]==="") {
9581
9619
  tmp[idname] = rowid;
9582
9620
  } else if (ind.id !== $t.p.idPrefix + tmp[idname]) {
9583
9621
  // rename rowid
@@ -9784,7 +9822,7 @@ $.jgrid.extend({
9784
9822
  });
9785
9823
  },
9786
9824
  inlineNav : function (elem, o) {
9787
- o = $.extend({
9825
+ o = $.extend(true,{
9788
9826
  edit: true,
9789
9827
  editicon: "ui-icon-pencil",
9790
9828
  add: true,
@@ -10911,7 +10949,7 @@ $.jgrid.extend({
10911
10949
  loaded = $t.p.treeReader.loaded, lft, rgt, curLevel, ident,lftpos, twrap,
10912
10950
  ldat, lf;
10913
10951
  while(i<len) {
10914
- var ind = $t.rows[i].id, dind = $t.p._index[ind], expan;
10952
+ var ind = $.jgrid.stripPref($t.p.idPrefix, $t.rows[i].id), dind = $t.p._index[ind], expan;
10915
10953
  ldat = $t.p.data[dind];
10916
10954
  //$t.rows[i].level = ldat[level];
10917
10955
  if($t.p.treeGridModel == 'nested') {
@@ -10974,7 +11012,7 @@ $.jgrid.extend({
10974
11012
  .find("div.treeclick")
10975
11013
  .bind("click",function(e){
10976
11014
  var target = e.target || e.srcElement,
10977
- ind2 =$(target,$t.rows).closest("tr.jqgrow")[0].id,
11015
+ ind2 =$.jgrid.stripPref($t.p.idPrefix,$(target,$t.rows).closest("tr.jqgrow")[0].id),
10978
11016
  pos = $t.p._index[ind2];
10979
11017
  if(!$t.p.data[pos][isLeaf]){
10980
11018
  if($t.p.data[pos][expanded]){
@@ -10993,7 +11031,7 @@ $.jgrid.extend({
10993
11031
  .css("cursor","pointer")
10994
11032
  .bind("click",function(e) {
10995
11033
  var target = e.target || e.srcElement,
10996
- ind2 =$(target,$t.rows).closest("tr.jqgrow")[0].id,
11034
+ ind2 =$.jgrid.stripPref($t.p.idPrefix,$(target,$t.rows).closest("tr.jqgrow")[0].id),
10997
11035
  pos = $t.p._index[ind2];
10998
11036
  if(!$t.p.data[pos][isLeaf]){
10999
11037
  if($t.p.data[pos][expanded]){
@@ -11081,7 +11119,7 @@ $.jgrid.extend({
11081
11119
  expanded = $t.p.treeReader.expanded_field,
11082
11120
  rows = $t.rows;
11083
11121
  $(childern).each(function(){
11084
- var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
11122
+ var id = $t.p.idPrefix + $.jgrid.getAccessor(this,$t.p.localReader.id);
11085
11123
  $(rows.namedItem(id)).css("display","");
11086
11124
  if(this[expanded]) {
11087
11125
  $($t).jqGrid("expandRow",this);
@@ -11098,7 +11136,7 @@ $.jgrid.extend({
11098
11136
  expanded = $t.p.treeReader.expanded_field,
11099
11137
  rows = $t.rows;
11100
11138
  $(childern).each(function(){
11101
- var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
11139
+ var id = $t.p.idPrefix + $.jgrid.getAccessor(this,$t.p.localReader.id);
11102
11140
  $(rows.namedItem(id)).css("display","none");
11103
11141
  if(this[expanded]){
11104
11142
  $($t).jqGrid("collapseRow",this);
@@ -11203,7 +11241,7 @@ $.jgrid.extend({
11203
11241
  var parent_id = $t.p.treeReader.parent_id_field,
11204
11242
  dtid = $t.p.localReader.id;
11205
11243
  $(this.p.data).each(function(){
11206
- if(this[parent_id] === $.jgrid.stripPref($t.p.idPrefix, rc[dtid])) {
11244
+ if(this[parent_id] == $.jgrid.stripPref($t.p.idPrefix, rc[dtid])) {
11207
11245
  result.push(this);
11208
11246
  }
11209
11247
  });
@@ -11308,7 +11346,7 @@ $.jgrid.extend({
11308
11346
 
11309
11347
  if(!rc[expanded]) {
11310
11348
  var id = $.jgrid.getAccessor(rc,this.p.localReader.id);
11311
- var rc1 = $("#"+$.jgrid.jqID(id),this.grid.bDiv)[0];
11349
+ var rc1 = $("#" + this.p.idPrefix + $.jgrid.jqID(id),this.grid.bDiv)[0];
11312
11350
  var position = this.p._index[id];
11313
11351
  if( $(this).jqGrid("isNodeLoaded",this.p.data[position]) ) {
11314
11352
  rc[expanded] = true;
@@ -11341,7 +11379,7 @@ $.jgrid.extend({
11341
11379
  if(rc[expanded]) {
11342
11380
  rc[expanded] = false;
11343
11381
  var id = $.jgrid.getAccessor(rc,this.p.localReader.id);
11344
- var rc1 = $("#"+$.jgrid.jqID(id),this.grid.bDiv)[0];
11382
+ var rc1 = $("#" + this.p.idPrefix + $.jgrid.jqID(id),this.grid.bDiv)[0];
11345
11383
  $("div.treeclick",rc1).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus");
11346
11384
  }
11347
11385
  });
@@ -12186,12 +12224,12 @@ hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function()
12186
12224
  // @compilation_level SIMPLE_OPTIMIZATIONS
12187
12225
 
12188
12226
  /**
12189
- * @license jqGrid 4.5.0 - jQuery Grid
12227
+ * @license jqGrid 4.5.1 - jQuery Grid
12190
12228
  * Copyright (c) 2008, Tony Tomov, tony@trirand.com
12191
12229
  * Dual licensed under the MIT and GPL licenses
12192
12230
  * http://www.opensource.org/licenses/mit-license.php
12193
12231
  * http://www.gnu.org/licenses/gpl-2.0.html
12194
- * Date: 2013-05-13
12232
+ * Date: 2013-05-21
12195
12233
  */
12196
12234
  //jsHint options
12197
12235
  /*jshint evil:true, eqeqeq:false, eqnull:true, devel:true */
@@ -12201,7 +12239,7 @@ hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function()
12201
12239
  "use strict";
12202
12240
  $.jgrid = $.jgrid || {};
12203
12241
  $.extend($.jgrid,{
12204
- version : "4.5.0",
12242
+ version : "4.5.1",
12205
12243
  htmlDecode : function(value){
12206
12244
  if(value && (value==='&nbsp;' || value==='&#160;' || (value.length===1 && value.charCodeAt(0)===160))) { return "";}
12207
12245
  return !value ? value : String(value).replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&quot;/g, '"').replace(/&amp;/g, "&");
@@ -12311,7 +12349,7 @@ $.extend($.jgrid,{
12311
12349
  if(dM !== -1 && dM < 12){date[k] = dM+1; ts.m = date[k];}
12312
12350
  }
12313
12351
  if(format[k] === 'F') {
12314
- dM = $.inArray(date[k],opts.monthNames);
12352
+ dM = $.inArray(date[k],opts.monthNames,12);
12315
12353
  if(dM !== -1 && dM > 11){date[k] = dM+1-12; ts.m = date[k];}
12316
12354
  }
12317
12355
  if(format[k] === 'a') {
@@ -14328,8 +14366,9 @@ $.fn.jqGrid = function( pin ) {
14328
14366
  });
14329
14367
  }
14330
14368
  },
14331
- multiSort = function(iCol, reload, sorder) {
14332
- var splas, sort="", cm = ts.p.colModel, fs=false, ls, selTh = ts.grid.headers[iCol].el, so="";
14369
+ multiSort = function(iCol, obj ) {
14370
+ var splas, sort="", cm = ts.p.colModel, fs=false, ls,
14371
+ selTh = ts.p.frozenColumns ? obj : ts.grid.headers[iCol].el, so="";
14333
14372
  $("span.ui-grid-ico-sort",selTh).addClass('ui-state-disabled');
14334
14373
  $(selTh).attr("aria-selected","false");
14335
14374
 
@@ -14372,7 +14411,7 @@ $.fn.jqGrid = function( pin ) {
14372
14411
  sort = sort.substring(0, ls);
14373
14412
  ts.p.sortname = sort;
14374
14413
  },
14375
- sortData = function (index, idxcol,reload,sor){
14414
+ sortData = function (index, idxcol,reload,sor, obj){
14376
14415
  if(!ts.p.colModel[idxcol].sortable) { return; }
14377
14416
  var so;
14378
14417
  if(ts.p.savedRow.length > 0) {return;}
@@ -14385,20 +14424,27 @@ $.fn.jqGrid = function( pin ) {
14385
14424
  ts.p.page = 1;
14386
14425
  }
14387
14426
  if(ts.p.multiSort) {
14388
- multiSort( idxcol, reload, so);
14427
+ multiSort( idxcol, obj);
14389
14428
  } else {
14390
14429
  if(sor) {
14391
14430
  if(ts.p.lastsort === idxcol && ts.p.sortorder === sor && !reload) { return; }
14392
14431
  ts.p.sortorder = sor;
14393
14432
  }
14394
- var previousSelectedTh = ts.grid.headers[ts.p.lastsort].el, newSelectedTh = ts.grid.headers[idxcol].el;
14433
+ var previousSelectedTh = ts.grid.headers[ts.p.lastsort].el, newSelectedTh = ts.p.frozenColumns ? obj : ts.grid.headers[idxcol].el;
14395
14434
 
14396
14435
  $("span.ui-grid-ico-sort",previousSelectedTh).addClass('ui-state-disabled');
14397
14436
  $(previousSelectedTh).attr("aria-selected","false");
14437
+ if(ts.p.frozenColumns) {
14438
+ ts.grid.fhDiv.find("span.ui-grid-ico-sort").addClass('ui-state-disabled');
14439
+ ts.grid.fhDiv.find("th").attr("aria-selected","false");
14440
+ }
14398
14441
  $("span.ui-icon-"+ts.p.sortorder,newSelectedTh).removeClass('ui-state-disabled');
14399
14442
  $(newSelectedTh).attr("aria-selected","true");
14400
14443
  if(!ts.p.viewsortcols[0]) {
14401
14444
  if(ts.p.lastsort !== idxcol) {
14445
+ if(ts.p.frozenColumns){
14446
+ ts.grid.fhDiv.find("span.s-ico").hide();
14447
+ }
14402
14448
  $("span.s-ico",previousSelectedTh).hide();
14403
14449
  $("span.s-ico",newSelectedTh).show();
14404
14450
  }
@@ -14755,9 +14801,21 @@ $.fn.jqGrid = function( pin ) {
14755
14801
  if (!ts.p.viewsortcols[2]) { s = "th>div>span>span.ui-grid-ico-sort"; }
14756
14802
  var t = $(e.target).closest(s);
14757
14803
  if (t.length !== 1) { return; }
14758
- var ci = getColumnHeaderIndex(this);
14804
+ var ci;
14805
+ if(ts.p.frozenColumns) {
14806
+ var tid = $(this)[0].id.substring(5);
14807
+ $(ts.p.colModel).each(function(i){
14808
+ if (this.name === tid) {
14809
+ ci = i;return false;
14810
+ }
14811
+ });
14812
+ } else {
14813
+ ci = getColumnHeaderIndex(this);
14814
+ }
14759
14815
  if (!ts.p.viewsortcols[2]) { r=true;d=t.attr("sort"); }
14760
- sortData( $('div',this)[0].id, ci, r, d);
14816
+ if(ci != null){
14817
+ sortData( $('div',this)[0].id, ci, r, d, this);
14818
+ }
14761
14819
  return false;
14762
14820
  });
14763
14821
  if (ts.p.sortable && $.fn.sortable) {
@@ -16312,10 +16370,17 @@ $.jgrid.extend({
16312
16370
  top=parseInt(top,10) + 18;
16313
16371
 
16314
16372
  var fs = $('.ui-jqgrid-view').css('font-size') || '11px';
16315
- var str = '<ul id="sopt_menu" class="ui-search-menu" role="menu" tabindex="0" style="font-size:'+fs+';left:'+left+'px;top:'+top+'px;">',
16316
- cm = $t.p.colModel[parseInt( $(elem).attr("colindex") )],
16373
+ var str = '<ul id="sopt_menu" class="ui-search-menu" role="menu" tabindex="0" style="font-size:'+fs+';left:'+left+'px;top:'+top+'px;">',
16317
16374
  selected = $(elem).attr("soper"), selclass,
16318
- aoprs = [], i, ina, options = $.extend({}, cm.searchoptions);
16375
+ aoprs = [], i, ina;
16376
+ var i=0, nm =$(elem).attr("colname"),len = $t.p.colModel.length;
16377
+ while(i<len) {
16378
+ if($t.p.colModel[i].name === nm) {
16379
+ break;
16380
+ }
16381
+ i++;
16382
+ }
16383
+ var cm = $t.p.colModel[i], options = $.extend({}, cm.searchoptions);
16319
16384
  if(!options.sopt) {
16320
16385
  options.sopt = [];
16321
16386
  options.sopt[0]= cm.stype==='select' ? 'eq' : p.defaultSearch;
@@ -16325,7 +16390,7 @@ $.jgrid.extend({
16325
16390
  ina = $.inArray(options.sopt[i],aoprs);
16326
16391
  if(ina !== -1) {
16327
16392
  selclass = selected === p.odata[ina].oper ? "ui-state-highlight" : "";
16328
- str += '<li class="ui-menu-item '+selclass+'" role="presentation"><a href="#" class="ui-corner-all g-menu-item" tabindex="0" role="menuitem" value="'+p.odata[ina].oper+'" oper="'+p.operands[p.odata[ina].oper]+'"><table cellspacing="0" cellpadding="0" border="0"><tr><td width="25px">'+p.operands[p.odata[ina].oper]+'</td><td>'+ p.odata[ina].text+'</td></tr></table></a></li>';
16393
+ str += '<li class="ui-menu-item '+selclass+'" role="presentation"><a class="ui-corner-all g-menu-item" tabindex="0" role="menuitem" value="'+p.odata[ina].oper+'" oper="'+p.operands[p.odata[ina].oper]+'"><table cellspacing="0" cellpadding="0" border="0"><tr><td width="25px">'+p.operands[p.odata[ina].oper]+'</td><td>'+ p.odata[ina].text+'</td></tr></table></a></li>';
16329
16394
  }
16330
16395
  }
16331
16396
  str += "</ul>";
@@ -16351,7 +16416,7 @@ $.jgrid.extend({
16351
16416
  // create the row
16352
16417
  var tr = $("<tr class='ui-search-toolbar' role='rowheader'></tr>");
16353
16418
  var timeoutHnd;
16354
- $.each($t.p.colModel,function(colindex){
16419
+ $.each($t.p.colModel,function(){
16355
16420
  var cm=this, soptions, surl, self, select = "", sot="=", so,
16356
16421
  th = $("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+$t.p.direction+"'></th>"),
16357
16422
  thd = $("<div style='position:relative;height:100%;padding-right:0.3em;padding-left:0.3em;'></div>"),
@@ -16370,7 +16435,7 @@ $.jgrid.extend({
16370
16435
  }
16371
16436
  }
16372
16437
  var st = soptions.searchtitle != null ? soptions.searchtitle : p.operandTitle;
16373
- select = "<a href='#' title='"+st+"' style='padding-right: 0.5em;' soper='"+so+"' class='soptclass' colindex='"+colindex+"'>"+sot+"</a>";
16438
+ select = "<a title='"+st+"' style='padding-right: 0.5em;' soper='"+so+"' class='soptclass' colname='"+this.name+"'>"+sot+"</a>";
16374
16439
  }
16375
16440
  $("td:eq(0)",stbl).append(select);
16376
16441
  switch (this.stype)
@@ -16533,6 +16598,12 @@ $.jgrid.extend({
16533
16598
  left = ( offset.left ),
16534
16599
  top = ( offset.top);
16535
16600
  buildRuleMenu(this, left, top );
16601
+ e.stopPropagation();
16602
+ });
16603
+ $("body").on('click', function(e){
16604
+ if(e.target.className !== "soptclass") {
16605
+ $("#sopt_menu").hide();
16606
+ }
16536
16607
  });
16537
16608
  }
16538
16609
  this.ftoolbar = true;
@@ -16776,9 +16847,14 @@ $.jgrid.extend({
16776
16847
  $("tr.jqg-first-row-header, tr.jqg-third-row-header", htbl).each(function(){
16777
16848
  $("th:gt("+maxfrozen+")",this).remove();
16778
16849
  });
16779
- var swapfroz = -1, fdel = -1;
16850
+ var swapfroz = -1, fdel = -1, cs, rs;
16780
16851
  $("tr.jqg-second-row-header th", htbl).each(function(){
16781
- var cs= parseInt($(this).attr("colspan"),10);
16852
+ cs= parseInt($(this).attr("colspan"),10);
16853
+ rs= parseInt($(this).attr("rowspan"),10);
16854
+ if(rs) {
16855
+ swapfroz++;
16856
+ fdel++;
16857
+ }
16782
16858
  if(cs) {
16783
16859
  swapfroz = swapfroz+cs;
16784
16860
  fdel++;
@@ -19977,14 +20053,14 @@ $.jgrid.extend({
19977
20053
  } else {
19978
20054
  $($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
19979
20055
  }
19980
- if(rp_ge[$t.p.id].closeAfterAdd) {
19981
- if($t.p.treeGrid !== true){
19982
- $($t).jqGrid("setSelection",ret[2]);
19983
- }
19984
- $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
19985
- } else if (rp_ge[$t.p.id].clearAfterAdd) {
19986
- fillData("_empty",$t,frmgr);
20056
+ }
20057
+ if(rp_ge[$t.p.id].closeAfterAdd) {
20058
+ if($t.p.treeGrid !== true){
20059
+ $($t).jqGrid("setSelection",ret[2]);
19987
20060
  }
20061
+ $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
20062
+ } else if (rp_ge[$t.p.id].clearAfterAdd) {
20063
+ fillData("_empty",$t,frmgr);
19988
20064
  }
19989
20065
  } else {
19990
20066
  // the action is update
@@ -20010,7 +20086,7 @@ $.jgrid.extend({
20010
20086
  }
20011
20087
  if(rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {
20012
20088
  $("#"+frmgr).data("disabled",false);
20013
- if(rp_ge[$t.p.id]._savedData[$t.p.id+"_id"] !="_empty"){
20089
+ if(rp_ge[$t.p.id]._savedData[$t.p.id+"_id"] !== "_empty"){
20014
20090
  for(key in rp_ge[$t.p.id]._savedData) {
20015
20091
  if(rp_ge[$t.p.id]._savedData.hasOwnProperty(key) && postdata[key]) {
20016
20092
  rp_ge[$t.p.id]._savedData[key] = postdata[key];
@@ -20042,10 +20118,10 @@ $.jgrid.extend({
20042
20118
  ret[0] = false;
20043
20119
  ret[1] = dpret[1] || "Error deleting the selected row!" ;
20044
20120
  } else {
20045
- if(ajaxOptions.data.oper == opers.addoper && rp_ge[$t.p.id].closeAfterAdd ) {
20121
+ if(ajaxOptions.data.oper === opers.addoper && rp_ge[$t.p.id].closeAfterAdd ) {
20046
20122
  $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
20047
20123
  }
20048
- if(ajaxOptions.data.oper == opers.editoper && rp_ge[$t.p.id].closeAfterEdit ) {
20124
+ if(ajaxOptions.data.oper === opers.editoper && rp_ge[$t.p.id].closeAfterEdit ) {
20049
20125
  $.jgrid.hideModal("#"+$.jgrid.jqID(IDs.themodal),{gb:"#gbox_"+$.jgrid.jqID(gID),jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
20050
20126
  }
20051
20127
  }
@@ -21559,7 +21635,7 @@ $.jgrid.extend({
21559
21635
  }
21560
21636
  if(tmp) {
21561
21637
  tmp[opers.oper] = opers.editoper;
21562
- if (tmp[idname] === undefined) {
21638
+ if (tmp[idname] === undefined || tmp[idname]==="") {
21563
21639
  tmp[idname] = rowid;
21564
21640
  } else if (ind.id !== $t.p.idPrefix + tmp[idname]) {
21565
21641
  // rename rowid
@@ -21766,7 +21842,7 @@ $.jgrid.extend({
21766
21842
  });
21767
21843
  },
21768
21844
  inlineNav : function (elem, o) {
21769
- o = $.extend({
21845
+ o = $.extend(true,{
21770
21846
  edit: true,
21771
21847
  editicon: "ui-icon-pencil",
21772
21848
  add: true,
@@ -22766,7 +22842,7 @@ $.jgrid.extend({
22766
22842
  loaded = $t.p.treeReader.loaded, lft, rgt, curLevel, ident,lftpos, twrap,
22767
22843
  ldat, lf;
22768
22844
  while(i<len) {
22769
- var ind = $t.rows[i].id, dind = $t.p._index[ind], expan;
22845
+ var ind = $.jgrid.stripPref($t.p.idPrefix, $t.rows[i].id), dind = $t.p._index[ind], expan;
22770
22846
  ldat = $t.p.data[dind];
22771
22847
  //$t.rows[i].level = ldat[level];
22772
22848
  if($t.p.treeGridModel == 'nested') {
@@ -22829,7 +22905,7 @@ $.jgrid.extend({
22829
22905
  .find("div.treeclick")
22830
22906
  .bind("click",function(e){
22831
22907
  var target = e.target || e.srcElement,
22832
- ind2 =$(target,$t.rows).closest("tr.jqgrow")[0].id,
22908
+ ind2 =$.jgrid.stripPref($t.p.idPrefix,$(target,$t.rows).closest("tr.jqgrow")[0].id),
22833
22909
  pos = $t.p._index[ind2];
22834
22910
  if(!$t.p.data[pos][isLeaf]){
22835
22911
  if($t.p.data[pos][expanded]){
@@ -22848,7 +22924,7 @@ $.jgrid.extend({
22848
22924
  .css("cursor","pointer")
22849
22925
  .bind("click",function(e) {
22850
22926
  var target = e.target || e.srcElement,
22851
- ind2 =$(target,$t.rows).closest("tr.jqgrow")[0].id,
22927
+ ind2 =$.jgrid.stripPref($t.p.idPrefix,$(target,$t.rows).closest("tr.jqgrow")[0].id),
22852
22928
  pos = $t.p._index[ind2];
22853
22929
  if(!$t.p.data[pos][isLeaf]){
22854
22930
  if($t.p.data[pos][expanded]){
@@ -22936,7 +23012,7 @@ $.jgrid.extend({
22936
23012
  expanded = $t.p.treeReader.expanded_field,
22937
23013
  rows = $t.rows;
22938
23014
  $(childern).each(function(){
22939
- var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
23015
+ var id = $t.p.idPrefix + $.jgrid.getAccessor(this,$t.p.localReader.id);
22940
23016
  $(rows.namedItem(id)).css("display","");
22941
23017
  if(this[expanded]) {
22942
23018
  $($t).jqGrid("expandRow",this);
@@ -22953,7 +23029,7 @@ $.jgrid.extend({
22953
23029
  expanded = $t.p.treeReader.expanded_field,
22954
23030
  rows = $t.rows;
22955
23031
  $(childern).each(function(){
22956
- var id = $.jgrid.getAccessor(this,$t.p.localReader.id);
23032
+ var id = $t.p.idPrefix + $.jgrid.getAccessor(this,$t.p.localReader.id);
22957
23033
  $(rows.namedItem(id)).css("display","none");
22958
23034
  if(this[expanded]){
22959
23035
  $($t).jqGrid("collapseRow",this);
@@ -23058,7 +23134,7 @@ $.jgrid.extend({
23058
23134
  var parent_id = $t.p.treeReader.parent_id_field,
23059
23135
  dtid = $t.p.localReader.id;
23060
23136
  $(this.p.data).each(function(){
23061
- if(this[parent_id] === $.jgrid.stripPref($t.p.idPrefix, rc[dtid])) {
23137
+ if(this[parent_id] == $.jgrid.stripPref($t.p.idPrefix, rc[dtid])) {
23062
23138
  result.push(this);
23063
23139
  }
23064
23140
  });
@@ -23163,7 +23239,7 @@ $.jgrid.extend({
23163
23239
 
23164
23240
  if(!rc[expanded]) {
23165
23241
  var id = $.jgrid.getAccessor(rc,this.p.localReader.id);
23166
- var rc1 = $("#"+$.jgrid.jqID(id),this.grid.bDiv)[0];
23242
+ var rc1 = $("#" + this.p.idPrefix + $.jgrid.jqID(id),this.grid.bDiv)[0];
23167
23243
  var position = this.p._index[id];
23168
23244
  if( $(this).jqGrid("isNodeLoaded",this.p.data[position]) ) {
23169
23245
  rc[expanded] = true;
@@ -23196,7 +23272,7 @@ $.jgrid.extend({
23196
23272
  if(rc[expanded]) {
23197
23273
  rc[expanded] = false;
23198
23274
  var id = $.jgrid.getAccessor(rc,this.p.localReader.id);
23199
- var rc1 = $("#"+$.jgrid.jqID(id),this.grid.bDiv)[0];
23275
+ var rc1 = $("#" + this.p.idPrefix + $.jgrid.jqID(id),this.grid.bDiv)[0];
23200
23276
  $("div.treeclick",rc1).removeClass(this.p.treeIcons.minus+" tree-minus").addClass(this.p.treeIcons.plus+" tree-plus");
23201
23277
  }
23202
23278
  });