compass-jquery-plugin 0.3.3.0 → 0.3.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. data/README.md +4 -4
  2. data/VERSION.yml +1 -1
  3. data/lib/handle_js_files.rb +1 -1
  4. data/lib/jquery/gridify/grid_column.rb +4 -0
  5. data/lib/jquery/gridify/grid_options.rb +5 -1
  6. data/lib/jquery/gridify/grid_view.rb +8 -3
  7. data/templates/dynatree/jquery.dynatree.js +184 -73
  8. data/templates/dynatree/jquery.dynatree.min.js +78 -76
  9. data/templates/emulators/emulators/galaxy.tab.7.7.landscape.png +0 -0
  10. data/templates/emulators/emulators/{palm.pre.2.landscape.scss → galaxy.tab.7.7.landscape.scss} +7 -7
  11. data/templates/emulators/emulators/galaxy.tab.7.7.portrait.png +0 -0
  12. data/templates/emulators/emulators/{palm.pre.2.portrait.scss → galaxy.tab.7.7.portrait.scss} +7 -7
  13. data/templates/emulators/manifest.rb +4 -4
  14. data/templates/graphics/config/initializers/graphics.rb +1 -1
  15. data/templates/graphics/highcharts/dark-blue.js +257 -159
  16. data/templates/graphics/highcharts/dark-blue.min.js +4 -2
  17. data/templates/graphics/highcharts/dark-green.js +257 -159
  18. data/templates/graphics/highcharts/dark-green.min.js +4 -2
  19. data/templates/graphics/highcharts/gray.js +252 -154
  20. data/templates/graphics/highcharts/gray.min.js +4 -2
  21. data/templates/graphics/highcharts/grid.js +84 -84
  22. data/templates/graphics/highcharts/highslide-full.min.js +3 -3
  23. data/templates/graphics/highcharts/highslide.js +3391 -0
  24. data/templates/graphics/highcharts/highslide.min.js +132 -0
  25. data/templates/graphics/jquery.ganttView.min.js +4 -4
  26. data/templates/graphics/jquery.highcharts.js +15379 -1071
  27. data/templates/graphics/jquery.highcharts.min.js +384 -167
  28. data/templates/graphics/jquery.sparkline.min.js +2 -2
  29. data/templates/graphics/manifest.rb +2 -0
  30. data/templates/ical/jquery.ical.min.js +46 -47
  31. data/templates/jqgrid/i18n/jqgrid/locale-bg.min.js +2 -2
  32. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.min.js +2 -2
  33. data/templates/jqgrid/i18n/jqgrid/locale-fi.js +20 -19
  34. data/templates/jqgrid/i18n/jqgrid/locale-fi.min.js +7 -6
  35. data/templates/jqgrid/i18n/jqgrid/locale-is.js +28 -28
  36. data/templates/jqgrid/i18n/jqgrid/locale-is.min.js +6 -6
  37. data/templates/jqgrid/i18n/jqgrid/locale-th.js +134 -0
  38. data/templates/jqgrid/i18n/jqgrid/locale-th.min.js +6 -0
  39. data/templates/jqgrid/jquery.jqGrid.js +674 -598
  40. data/templates/jqgrid/jquery.jqGrid.min.js +444 -441
  41. data/templates/jqgrid/jquery/jqGrid.scss +0 -3
  42. data/templates/jqgrid/manifest.rb +2 -0
  43. data/templates/jqtouch/jquery.jqtouch.js +201 -156
  44. data/templates/jqtouch/jquery.jqtouch.min.js +1 -1
  45. data/templates/jqtouch/jquery/touch/apple.scss +2 -2
  46. data/templates/jqtouch/jquery/touch/default.scss +2 -2
  47. data/templates/jquery/amplify.store.js +111 -78
  48. data/templates/jquery/amplify.store.min.js +6 -6
  49. data/templates/jquery/history.js +3 -3
  50. data/templates/jquery/i18n/jquery.ui/datepicker-nl.js +1 -1
  51. data/templates/jquery/i18n/jquery.ui/datepicker-nl.min.js +1 -1
  52. data/templates/jquery/jquery-ui.js +1286 -1042
  53. data/templates/jquery/jquery-ui.min.js +320 -316
  54. data/templates/jquery/jquery.contextMenu.js +2 -2
  55. data/templates/jquery/jquery.easing.js +152 -152
  56. data/templates/jquery/jquery.easing.min.js +7 -7
  57. data/templates/jquery/jquery.farbtastic.min.js +2 -2
  58. data/templates/jquery/jquery.form.js +30 -30
  59. data/templates/jquery/jquery.haml.min.js +5 -5
  60. data/templates/jquery/jquery.hotkeys.min.js +1 -1
  61. data/templates/jquery/jquery.js +419 -311
  62. data/templates/jquery/jquery.layout.js +59 -40
  63. data/templates/jquery/jquery.min.js +176 -176
  64. data/templates/jquery/jquery.themeswitchertool.js +37 -37
  65. data/templates/jquery/jquery.tmpl.js +4 -4
  66. data/templates/jquery/jquery.tmpl.min.js +9 -9
  67. data/templates/jquery/jquery.tmplPlus.min.js +3 -3
  68. data/templates/jquery/jquery.tokeninput.js +613 -490
  69. data/templates/jquery/jquery.tokeninput.min.js +17 -14
  70. data/templates/jquery/jquery/ui/_theme.scss +39 -63
  71. data/templates/jquery/json.js +31 -15
  72. data/templates/jstree/jquery.jstree.js +415 -410
  73. data/templates/jstree/jquery.jstree.min.js +134 -133
  74. data/templates/markitup/jquery.markitup.js +567 -560
  75. data/templates/markitup/jquery.markitup.min.js +1 -1
  76. data/templates/markitup/jquery/markitup/sets/default.scss +7 -3
  77. data/templates/markitup/jquery/markitup/sets/default/list-bullet.png +0 -0
  78. data/templates/markitup/jquery/markitup/sets/default/list-numeric.png +0 -0
  79. data/templates/markitup/jquery/markitup/skins/markitup.scss +3 -10
  80. data/templates/markitup/jquery/markitup/skins/markitup/bg-container.png +0 -0
  81. data/templates/markitup/jquery/markitup/skins/markitup/menu.png +0 -0
  82. data/templates/markitup/jquery/markitup/skins/simple.scss +2 -3
  83. data/templates/markitup/jquery/markitup/skins/simple/menu.png +0 -0
  84. data/templates/markitup/manifest.rb +2 -0
  85. data/templates/markitup/markitup/jquery.markitup.set.default.js +21 -21
  86. data/templates/markitup/markitup/jquery.markitup.set.default.min.js +3 -2
  87. data/templates/mobile/jquery.mobile.js +5230 -2846
  88. data/templates/mobile/jquery.mobile.min.js +192 -46
  89. data/templates/mobile/jquery/mobile/_base.scss +141 -18
  90. data/templates/mobile/jquery/mobile/default.scss +263 -66
  91. data/templates/mobile/jquery/mobile/default/icons-18-black.png +0 -0
  92. data/templates/mobile/jquery/mobile/default/icons-18-white.png +0 -0
  93. data/templates/mobile/jquery/mobile/default/icons-36-black.png +0 -0
  94. data/templates/mobile/jquery/mobile/default/icons-36-white.png +0 -0
  95. data/templates/mobile/jquery/mobile/valencia.scss +242 -53
  96. data/templates/mobile/jquery/mobile/valencia/icons-18-black.png +0 -0
  97. data/templates/mobile/jquery/mobile/valencia/icons-18-white.png +0 -0
  98. data/templates/mobile/jquery/mobile/valencia/icons-36-black.png +0 -0
  99. data/templates/mobile/jquery/mobile/valencia/icons-36-white.png +0 -0
  100. data/templates/tiny_mce/manifest.rb +2 -0
  101. data/templates/tiny_mce/tiny_mce/langs/de.js +1 -1
  102. data/templates/tiny_mce/tiny_mce/plugins/advhr/rule.htm +1 -1
  103. data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin.js +1 -1
  104. data/templates/tiny_mce/tiny_mce/plugins/advimage/editor_plugin_src.js +1 -1
  105. data/templates/tiny_mce/tiny_mce/plugins/advimage/image.htm +1 -1
  106. data/templates/tiny_mce/tiny_mce/plugins/advimage/js/image.js +1 -1
  107. data/templates/tiny_mce/tiny_mce/plugins/advlink/link.htm +1 -1
  108. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin.js +1 -1
  109. data/templates/tiny_mce/tiny_mce/plugins/advlist/editor_plugin_src.js +1 -1
  110. data/templates/tiny_mce/tiny_mce/plugins/autolink/editor_plugin.js +1 -1
  111. data/templates/tiny_mce/tiny_mce/plugins/autolink/editor_plugin_src.js +1 -1
  112. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin.js +1 -1
  113. data/templates/tiny_mce/tiny_mce/plugins/autoresize/editor_plugin_src.js +1 -1
  114. data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin.js +1 -1
  115. data/templates/tiny_mce/tiny_mce/plugins/autosave/editor_plugin_src.js +1 -1
  116. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -1
  117. data/templates/tiny_mce/tiny_mce/plugins/contextmenu/editor_plugin_src.js +1 -1
  118. data/templates/tiny_mce/tiny_mce/plugins/emotions/emotions.htm +1 -1
  119. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  120. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
  121. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
  122. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
  123. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
  124. data/templates/tiny_mce/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
  125. data/templates/tiny_mce/tiny_mce/plugins/example/dialog.htm +1 -1
  126. data/templates/tiny_mce/tiny_mce/plugins/example_dependency/editor_plugin.js +1 -0
  127. data/templates/tiny_mce/tiny_mce/plugins/example_dependency/editor_plugin_src.js +1 -0
  128. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin.js +1 -1
  129. data/templates/tiny_mce/tiny_mce/plugins/fullpage/editor_plugin_src.js +1 -1
  130. data/templates/tiny_mce/tiny_mce/plugins/fullpage/fullpage.htm +1 -1
  131. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -1
  132. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +1 -1
  133. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  134. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  135. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  136. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  137. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  138. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +1 -1
  139. data/templates/tiny_mce/tiny_mce/plugins/inlinepopups/template.htm +1 -1
  140. data/templates/tiny_mce/tiny_mce/plugins/lists/editor_plugin.js +1 -1
  141. data/templates/tiny_mce/tiny_mce/plugins/lists/editor_plugin_src.js +1 -1
  142. data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin.js +1 -1
  143. data/templates/tiny_mce/tiny_mce/plugins/media/editor_plugin_src.js +1 -1
  144. data/templates/tiny_mce/tiny_mce/plugins/media/js/media.js +1 -1
  145. data/templates/tiny_mce/tiny_mce/plugins/media/langs/en_dlg.js +1 -1
  146. data/templates/tiny_mce/tiny_mce/plugins/media/media.htm +1 -1
  147. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin.js +1 -1
  148. data/templates/tiny_mce/tiny_mce/plugins/noneditable/editor_plugin_src.js +1 -1
  149. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin.js +1 -1
  150. data/templates/tiny_mce/tiny_mce/plugins/paste/editor_plugin_src.js +1 -1
  151. data/templates/tiny_mce/tiny_mce/plugins/paste/pastetext.htm +1 -1
  152. data/templates/tiny_mce/tiny_mce/plugins/paste/pasteword.htm +1 -1
  153. data/templates/tiny_mce/tiny_mce/plugins/preview/example.html +16 -17
  154. data/templates/tiny_mce/tiny_mce/plugins/preview/preview.html +9 -10
  155. data/templates/tiny_mce/tiny_mce/plugins/searchreplace/searchreplace.htm +1 -1
  156. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -1
  157. data/templates/tiny_mce/tiny_mce/plugins/spellchecker/editor_plugin_src.js +1 -1
  158. data/templates/tiny_mce/tiny_mce/plugins/style/js/props.js +1 -1
  159. data/templates/tiny_mce/tiny_mce/plugins/style/props.htm +1 -1
  160. data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -1
  161. data/templates/tiny_mce/tiny_mce/plugins/tabfocus/editor_plugin_src.js +1 -1
  162. data/templates/tiny_mce/tiny_mce/plugins/table/cell.htm +1 -1
  163. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin.js +1 -1
  164. data/templates/tiny_mce/tiny_mce/plugins/table/editor_plugin_src.js +1 -1
  165. data/templates/tiny_mce/tiny_mce/plugins/table/js/cell.js +1 -1
  166. data/templates/tiny_mce/tiny_mce/plugins/table/js/row.js +1 -1
  167. data/templates/tiny_mce/tiny_mce/plugins/table/langs/de_dlg.js +1 -1
  168. data/templates/tiny_mce/tiny_mce/plugins/table/langs/en_dlg.js +1 -1
  169. data/templates/tiny_mce/tiny_mce/plugins/table/merge_cells.htm +1 -1
  170. data/templates/tiny_mce/tiny_mce/plugins/table/row.htm +1 -1
  171. data/templates/tiny_mce/tiny_mce/plugins/table/table.htm +1 -1
  172. data/templates/tiny_mce/tiny_mce/plugins/template/blank.htm +1 -1
  173. data/templates/tiny_mce/tiny_mce/plugins/template/template.htm +1 -1
  174. data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin.js +1 -1
  175. data/templates/tiny_mce/tiny_mce/plugins/wordcount/editor_plugin_src.js +1 -1
  176. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/abbr.htm +1 -1
  177. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/acronym.htm +1 -1
  178. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/attributes.htm +1 -1
  179. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/cite.htm +1 -1
  180. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/del.htm +1 -1
  181. data/templates/tiny_mce/tiny_mce/plugins/xhtmlxtras/ins.htm +1 -1
  182. data/templates/tiny_mce/tiny_mce/themes/advanced/about.htm +1 -1
  183. data/templates/tiny_mce/tiny_mce/themes/advanced/anchor.htm +1 -1
  184. data/templates/tiny_mce/tiny_mce/themes/advanced/color_picker.htm +1 -1
  185. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template.js +1 -1
  186. data/templates/tiny_mce/tiny_mce/themes/advanced/editor_template_src.js +1 -1
  187. data/templates/tiny_mce/tiny_mce/themes/advanced/image.htm +1 -1
  188. data/templates/tiny_mce/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  189. data/templates/tiny_mce/tiny_mce/themes/advanced/img/flash.gif +0 -0
  190. data/templates/tiny_mce/tiny_mce/themes/advanced/img/icons.gif +0 -0
  191. data/templates/tiny_mce/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
  192. data/templates/tiny_mce/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
  193. data/templates/tiny_mce/tiny_mce/themes/advanced/js/image.js +1 -1
  194. data/templates/tiny_mce/tiny_mce/themes/advanced/langs/de.js +1 -1
  195. data/templates/tiny_mce/tiny_mce/themes/advanced/link.htm +1 -1
  196. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/content.css +1 -1
  197. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/dialog.css +1 -1
  198. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  199. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  200. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  201. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/default/ui.css +1 -1
  202. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +1 -1
  203. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/highcontrast/ui.css +1 -1
  204. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/content.css +1 -1
  205. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/dialog.css +1 -1
  206. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  207. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  208. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  209. data/templates/tiny_mce/tiny_mce/themes/advanced/skins/o2k7/ui.css +1 -1
  210. data/templates/tiny_mce/tiny_mce/themes/advanced/source_editor.htm +1 -1
  211. data/templates/tiny_mce/tiny_mce/themes/simple/img/icons.gif +0 -0
  212. data/templates/tiny_mce/tiny_mce/themes/simple/skins/default/ui.css +1 -1
  213. data/templates/tiny_mce/tiny_mce/themes/simple/skins/o2k7/ui.css +1 -1
  214. data/templates/tiny_mce/tiny_mce/tiny_mce.js +1 -1
  215. data/templates/tools/flowplayer.min.js +1 -1
  216. data/templates/tools/jquery.tools.js +17 -17
  217. data/templates/tools/jquery.tools.min.js +22 -22
  218. metadata +17 -9
  219. data/templates/emulators/emulators/palm.pre.2.landscape.png +0 -0
  220. data/templates/emulators/emulators/palm.pre.2.portrait.png +0 -0
@@ -0,0 +1,6 @@
1
+ (function(a){a.jgrid={defaults:{recordtext:"แสดง {0} - {1} จาก {2}",emptyrecords:"ไม่พบข้อมูล",loadtext:"กำลังร้องขอข้อมูล...",pgtext:"หน้า {0} จาก {1}"},search:{caption:"กำลังค้นหา...",Find:"ค้นหา",Reset:"คืนค่ากลับ",odata:["เท่ากับ","ไม่เท่ากับ","น้อยกว่า","ไม่มากกว่า","มากกกว่า","ไม่น้อยกว่า","ขึ้นต้นด้วย","ไม่ขึ้นต้นด้วย","มีคำใดคำหนึ่งใน","ไม่มีคำใดคำหนึ่งใน","ลงท้ายด้วย","ไม่ลงท้ายด้วย","มีคำว่า","ไม่มีคำว่า"],groupOps:[{op:"และ",text:"ทั้งหมด"},{op:"หรือ",text:"ใดๆ"}],matchText:" ตรงกันกับ",
2
+ rulesText:" ตามกฏ"},edit:{addCaption:"เพิ่มข้อมูล",editCaption:"แก้ไขข้อมูล",bSubmit:"บันทึก",bCancel:"ยกเลิก",bClose:"ปิด",saveData:"คุณต้องการบันทึการแก้ไข ใช่หรือไม่?",bYes:"บันทึก",bNo:"ละทิ้งการแก้ไข",bExit:"ยกเลิก",msg:{required:"ข้อมูลนี้จำเป็น",number:"กรุณากรอกหมายเลขให้ถูกต้อง",minValue:"ค่าของข้อมูลนี้ต้องไม่น้อยกว่า",maxValue:"ค่าของข้อมูลนี้ต้องไม่มากกว่า",email:"อีเมลล์นี้ไม่ถูกต้อง",integer:"กรุณากรอกเป็นจำนวนเต็ม",date:"กรุณากรอกวันที่ให้ถูกต้อง",url:"URL ไม่ถูกต้อง URL จำเป็นต้องขึ้นต้นด้วย 'http://' หรือ 'https://'",
3
+ nodefined:"ไม่ได้ถูกกำหนดค่า!",novalue:"ต้องการการคืนค่า!",customarray:"ฟังก์ชันที่สร้างขึ้นต้องส่งค่ากลับเป็นแบบแอเรย์",customfcheck:"ระบบต้องการฟังก์ชันที่สร้างขึ้นสำหรับการตรวจสอบ!"}},view:{caption:"เรียกดูข้อมูล",bClose:"ปิด"},del:{caption:"ลบข้อมูล",msg:"คุณต้องการลบข้อมูลที่ถูกเลือก ใช่หรือไม่?",bSubmit:"ต้องการลบ",bCancel:"ยกเลิก"},nav:{edittext:"",edittitle:"แก้ไขข้อมูล",addtext:"",addtitle:"เพิ่มข้อมูล",deltext:"",deltitle:"ลบข้อมูล",searchtext:"",searchtitle:"ค้นหาข้อมูล",refreshtext:"",
4
+ refreshtitle:"รีเฟรช",alertcap:"คำเตือน",alerttext:"กรุณาเลือกข้อมูล",viewtext:"",viewtitle:"ดูรายละเอียดข้อมูล"},col:{caption:"กรุณาเลือกคอลัมน์",bSubmit:"ตกลง",bCancel:"ยกเลิก"},errors:{errcap:"เกิดความผิดพลาด",nourl:"ไม่ได้กำหนด URL",norecords:"ไม่มีข้อมูลให้ดำเนินการ",model:"จำนวนคอลัมน์ไม่เท่ากับจำนวนคอลัมน์โมเดล!"},formatter:{integer:{thousandsSeparator:" ",defaultValue:"0"},number:{decimalSeparator:".",thousandsSeparator:" ",decimalPlaces:2,defaultValue:"0.00"},currency:{decimalSeparator:".",
5
+ thousandsSeparator:" ",decimalPlaces:2,prefix:"",suffix:"",defaultValue:"0.00"},date:{dayNames:["อา","จ","อ","พ","พฤ","ศ","ส","อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศูกร์","เสาร์"],monthNames:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.","มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฏาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],AmPm:["am","pm","AM","PM"],S:function(){return""},srcformat:"Y-m-d",newformat:"d/m/Y",masks:{ISO8601Long:"Y-m-d H:i:s",
6
+ ISO8601Short:"Y-m-d",ShortDate:"n/j/Y",LongDate:"l, F d, Y",FullDateTime:"l, F d, Y g:i:s A",MonthDay:"F d",ShortTime:"g:i A",LongTime:"g:i:s A",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F, Y"},reformatAfterEdit:!1},baseLinkUrl:"",showAction:"",target:"",checkbox:{disabled:!0},idName:"id"}}})(jQuery);
@@ -2,12 +2,12 @@
2
2
  // @compilation_level SIMPLE_OPTIMIZATIONS
3
3
 
4
4
  /**
5
- * @license jqGrid 4.0 - jQuery Grid
5
+ * @license jqGrid 4.1.2 - 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: 2011-04-09
10
+ * Date: 2011-07-20
11
11
  */
12
12
  //jsHint options
13
13
  /*global document, window, jQuery, DOMParser, ActiveXObject $ */
@@ -150,8 +150,7 @@
150
150
  return new Date(tsp.y, tsp.m, tsp.d, tsp.h, tsp.i, tsp.s, 0);
151
151
  },
152
152
  jqID : function(sid) {
153
- sid = sid + "";
154
- return sid.replace(/([\.\:\[\]])/g, "\\$1");
153
+ return String(sid).replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
155
154
  },
156
155
  guid : 1,
157
156
  uidPref: 'jqg',
@@ -198,6 +197,7 @@
198
197
  _stripNum = /[\$,%]/g,
199
198
  _lastCommand = null,
200
199
  _lastField = null,
200
+ _orDepth = 0,
201
201
  _negate = false,
202
202
  _queuedOperator = "",
203
203
  _sorting = [],
@@ -258,17 +258,22 @@
258
258
  return results;
259
259
  };
260
260
  this._append = function(s) {
261
+ var i;
261
262
  if (_query === null) {
262
263
  _query = "";
263
264
  } else {
264
265
  _query += _queuedOperator === "" ? " && " : _queuedOperator;
265
266
  }
267
+ for (i = 0; i < _orDepth; i++) {
268
+ _query += "(";
269
+ }
266
270
  if (_negate) {
267
271
  _query += "!";
268
272
  }
269
273
  _query += "(" + s + ")";
270
274
  _negate = false;
271
275
  _queuedOperator = "";
276
+ _orDepth = 0;
272
277
  };
273
278
  this._setCommand = function(f, c) {
274
279
  _lastCommand = f;
@@ -507,6 +512,16 @@
507
512
  }
508
513
  return self._repeatCommand(f, v, x);
509
514
  };
515
+ this.orBegin = function() {
516
+ _orDepth++;
517
+ return self;
518
+ };
519
+ this.orEnd = function() {
520
+ if (_query !== null) {
521
+ _query += ")";
522
+ }
523
+ return self;
524
+ };
510
525
  this.isNot = function(f) {
511
526
  _negate = !_negate;
512
527
  return self.is(f);
@@ -1211,7 +1226,7 @@
1211
1226
  ts.p.records = this.textContent || this.text || 0;
1212
1227
  });
1213
1228
  $(ts.p.xmlReader.userdata, xml).each(function() {
1214
- ts.p.userData[this.getAttribute("name")] = this.textContent || this.text;
1229
+ ts.p.userData[this.getAttribute("name")] = $(this).text();
1215
1230
  });
1216
1231
  var gxml = $(ts.p.xmlReader.root + " " + ts.p.xmlReader.row, xml);
1217
1232
  if (!gxml) {
@@ -1685,9 +1700,16 @@
1685
1700
  query = query.ignoreCase();
1686
1701
  }
1687
1702
  function tojLinq(group) {
1688
- var s = 0, index, opr, rule;
1703
+ var s = 0, index, gor, ror, opr, rule;
1689
1704
  if (group.groups !== undefined) {
1705
+ gor = group.groups.length && group.groupOp.toString().toUpperCase() === "OR";
1706
+ if (gor) {
1707
+ query.orBegin();
1708
+ }
1690
1709
  for (index = 0; index < group.groups.length; index++) {
1710
+ if (s > 0 && gor) {
1711
+ query.or();
1712
+ }
1691
1713
  try {
1692
1714
  tojLinq(group.groups[index]);
1693
1715
  } catch (e) {
@@ -1695,13 +1717,23 @@
1695
1717
  }
1696
1718
  s++;
1697
1719
  }
1720
+ if (gor) {
1721
+ query.orEnd();
1722
+ }
1698
1723
  }
1699
1724
  if (group.rules !== undefined) {
1700
1725
  if (s > 0) {
1701
1726
  var result = query.select();
1702
1727
  query = $.jgrid.from(result);
1728
+ if (ts.p.ignoreCase) {
1729
+ query = query.ignoreCase();
1730
+ }
1703
1731
  }
1704
1732
  try {
1733
+ ror = group.rules.length && group.groupOp.toString().toUpperCase() === "OR";
1734
+ if (ror) {
1735
+ query.orBegin();
1736
+ }
1705
1737
  for (index = 0; index < group.rules.length; index++) {
1706
1738
  rule = group.rules[index];
1707
1739
  opr = group.groupOp.toString().toUpperCase();
@@ -1713,6 +1745,9 @@
1713
1745
  }
1714
1746
  s++;
1715
1747
  }
1748
+ if (ror) {
1749
+ query.orEnd();
1750
+ }
1716
1751
  } catch (g) {
1717
1752
  alert(g);
1718
1753
  }
@@ -2252,7 +2287,7 @@
2252
2287
  $("tr th:eq(" + idxcol + ") span.s-ico", thd).show();
2253
2288
  }
2254
2289
  }
2255
- index = index.substring(5);
2290
+ index = index.substring(5 + ts.p.id.length + 1); // bad to be changed!?!
2256
2291
  ts.p.sortname = ts.p.colModel[idxcol].index || index;
2257
2292
  so = ts.p.sortorder;
2258
2293
  if ($.isFunction(ts.p.onSortCol)) {
@@ -2626,26 +2661,26 @@
2626
2661
  grid.dragStart(ci, e, getOffset(ci));
2627
2662
  return false;
2628
2663
  }).click(function(e) {
2629
- if (ts.p.disableClick) {
2630
- ts.p.disableClick = false;
2631
- return false;
2632
- }
2633
- var s = "th>div.ui-jqgrid-sortable",r,d;
2634
- if (!ts.p.viewsortcols[2]) {
2635
- s = "th>div>span>span.ui-grid-ico-sort";
2636
- }
2637
- var t = $(e.target).closest(s);
2638
- if (t.length != 1) {
2639
- return;
2640
- }
2641
- var ci = $.jgrid.getCellIndex(this);
2642
- if (!ts.p.viewsortcols[2]) {
2643
- r = true;
2644
- d = t.attr("sort");
2645
- }
2646
- sortData($('div', this)[0].id, ci, r, d);
2647
- return false;
2648
- });
2664
+ if (ts.p.disableClick) {
2665
+ ts.p.disableClick = false;
2666
+ return false;
2667
+ }
2668
+ var s = "th>div.ui-jqgrid-sortable",r,d;
2669
+ if (!ts.p.viewsortcols[2]) {
2670
+ s = "th>div>span>span.ui-grid-ico-sort";
2671
+ }
2672
+ var t = $(e.target).closest(s);
2673
+ if (t.length != 1) {
2674
+ return;
2675
+ }
2676
+ var ci = $.jgrid.getCellIndex(this);
2677
+ if (!ts.p.viewsortcols[2]) {
2678
+ r = true;
2679
+ d = t.attr("sort");
2680
+ }
2681
+ sortData($('div', this)[0].id, ci, r, d);
2682
+ return false;
2683
+ });
2649
2684
  if (ts.p.sortable && $.fn.sortable) {
2650
2685
  try {
2651
2686
  $(ts).jqGrid("sortableColumns", thr);
@@ -2697,12 +2732,10 @@
2697
2732
  if ($(ptr).attr("class") !== "subgrid") {
2698
2733
  $(ptr).addClass("ui-state-hover");
2699
2734
  }
2700
- return false;
2701
2735
  }).bind('mouseout', function(e) {
2702
- ptr = $(e.target).closest("tr.jqgrow");
2703
- $(ptr).removeClass("ui-state-hover");
2704
- return false;
2705
- });
2736
+ ptr = $(e.target).closest("tr.jqgrow");
2737
+ $(ptr).removeClass("ui-state-hover");
2738
+ });
2706
2739
  }
2707
2740
  var ri,ci;
2708
2741
  $(ts).before(grid.hDiv).click(
@@ -2763,57 +2796,58 @@
2763
2796
  ci = $.jgrid.getCellIndex(td);
2764
2797
  ts.p.onCellSelect.call(ts, ri, ci, $(td).html(), e);
2765
2798
  }
2766
- e.stopPropagation();
2767
- } else {
2768
- return this;
2799
+ //e.stopPropagation();
2769
2800
  }
2801
+ //else {
2802
+ return this;
2803
+ //}
2770
2804
  }).bind('reloadGrid', function(e, opts) {
2771
- if (ts.p.treeGrid === true) {
2772
- ts.p.datatype = ts.p.treedatatype;
2773
- }
2774
- if (opts && opts.current) {
2775
- ts.grid.selectionPreserver(ts);
2776
- }
2777
- if (ts.p.datatype == "local") {
2778
- $(ts).jqGrid("resetSelection");
2779
- if (ts.p.data.length) {
2780
- refreshIndex();
2781
- }
2782
- }
2783
- else if (!ts.p.treeGrid) {
2784
- ts.p.selrow = null;
2785
- if (ts.p.multiselect) {
2786
- ts.p.selarrrow = [];
2787
- $('#cb_' + $.jgrid.jqID(ts.p.id), ts.grid.hDiv).attr("checked", false);
2788
- }
2789
- ts.p.savedRow = [];
2790
- }
2791
- if (ts.p.scroll) {
2792
- emptyRows(ts.grid.bDiv, true, false);
2793
- }
2794
- if (opts && opts.page) {
2795
- var page = opts.page;
2796
- if (page > ts.p.lastpage) {
2797
- page = ts.p.lastpage;
2798
- }
2799
- if (page < 1) {
2800
- page = 1;
2801
- }
2802
- ts.p.page = page;
2803
- if (ts.grid.prevRowHeight) {
2804
- ts.grid.bDiv.scrollTop = (page - 1) * ts.grid.prevRowHeight * ts.p.rowNum;
2805
- } else {
2806
- ts.grid.bDiv.scrollTop = 0;
2807
- }
2808
- }
2809
- if (ts.grid.prevRowHeight && ts.p.scroll) {
2810
- delete ts.p.lastpage;
2811
- ts.grid.populateVisible();
2812
- } else {
2813
- ts.grid.populate();
2814
- }
2815
- return false;
2816
- });
2805
+ if (ts.p.treeGrid === true) {
2806
+ ts.p.datatype = ts.p.treedatatype;
2807
+ }
2808
+ if (opts && opts.current) {
2809
+ ts.grid.selectionPreserver(ts);
2810
+ }
2811
+ if (ts.p.datatype == "local") {
2812
+ $(ts).jqGrid("resetSelection");
2813
+ if (ts.p.data.length) {
2814
+ refreshIndex();
2815
+ }
2816
+ }
2817
+ else if (!ts.p.treeGrid) {
2818
+ ts.p.selrow = null;
2819
+ if (ts.p.multiselect) {
2820
+ ts.p.selarrrow = [];
2821
+ $('#cb_' + $.jgrid.jqID(ts.p.id), ts.grid.hDiv).attr("checked", false);
2822
+ }
2823
+ ts.p.savedRow = [];
2824
+ }
2825
+ if (ts.p.scroll) {
2826
+ emptyRows(ts.grid.bDiv, true, false);
2827
+ }
2828
+ if (opts && opts.page) {
2829
+ var page = opts.page;
2830
+ if (page > ts.p.lastpage) {
2831
+ page = ts.p.lastpage;
2832
+ }
2833
+ if (page < 1) {
2834
+ page = 1;
2835
+ }
2836
+ ts.p.page = page;
2837
+ if (ts.grid.prevRowHeight) {
2838
+ ts.grid.bDiv.scrollTop = (page - 1) * ts.grid.prevRowHeight * ts.p.rowNum;
2839
+ } else {
2840
+ ts.grid.bDiv.scrollTop = 0;
2841
+ }
2842
+ }
2843
+ if (ts.grid.prevRowHeight && ts.p.scroll) {
2844
+ delete ts.p.lastpage;
2845
+ ts.grid.populateVisible();
2846
+ } else {
2847
+ ts.grid.populate();
2848
+ }
2849
+ return false;
2850
+ });
2817
2851
  if ($.isFunction(this.p.ondblClickRow)) {
2818
2852
  $(this).dblclick(function(e) {
2819
2853
  td = e.target;
@@ -2827,22 +2861,22 @@
2827
2861
  return false;
2828
2862
  });
2829
2863
  }
2830
- // if ($.isFunction(this.p.onRightClickRow)) {
2831
- // $(this).bind('contextmenu', function(e) {
2832
- // td = e.target;
2833
- // ptr = $(td, ts.rows).closest("tr.jqgrow");
2834
- // if ($(ptr).length === 0) {
2835
- // return false;
2836
- // }
2837
- // if (!ts.p.multiselect) {
2838
- // $(ts).jqGrid("setSelection", ptr[0].id, true);
2839
- // }
2840
- // ri = ptr[0].rowIndex;
2841
- // ci = $.jgrid.getCellIndex(td);
2842
- // ts.p.onRightClickRow.call(ts, $(ptr).attr("id"), ri, ci, e);
2843
- // return false;
2844
- // });
2845
- // }
2864
+ /*if ($.isFunction(this.p.onRightClickRow)) {
2865
+ $(this).bind('contextmenu', function(e) {
2866
+ td = e.target;
2867
+ ptr = $(td, ts.rows).closest("tr.jqgrow");
2868
+ if ($(ptr).length === 0) {
2869
+ return false;
2870
+ }
2871
+ if (!ts.p.multiselect) {
2872
+ $(ts).jqGrid("setSelection", ptr[0].id, true);
2873
+ }
2874
+ ri = ptr[0].rowIndex;
2875
+ ci = $.jgrid.getCellIndex(td);
2876
+ ts.p.onRightClickRow.call(ts, $(ptr).attr("id"), ri, ci, e);
2877
+ return false;
2878
+ });
2879
+ }*/
2846
2880
  grid.bDiv = document.createElement("div");
2847
2881
  if (isMSIE) {
2848
2882
  if (String(ts.p.height).toLowerCase() === "auto") {
@@ -2994,11 +3028,11 @@
2994
3028
  }
2995
3029
  $(grid.hDiv).after(grid.bDiv)
2996
3030
  .mousemove(function (e) {
2997
- if (grid.resizing) {
2998
- grid.dragMove(e);
2999
- return false;
3000
- }
3001
- });
3031
+ if (grid.resizing) {
3032
+ grid.dragMove(e);
3033
+ return false;
3034
+ }
3035
+ });
3002
3036
  $(".ui-jqgrid-labels", grid.hDiv).bind("selectstart", function () {
3003
3037
  return false;
3004
3038
  });
@@ -3166,6 +3200,12 @@
3166
3200
  $("#cb_" + $.jgrid.jqID(t.p.id)).attr("checked", false);
3167
3201
  t.p.selarrrow = [];
3168
3202
  }
3203
+ if (t.p.cellEdit === true) {
3204
+ if (parseInt(t.p.iCol, 10) >= 0 && parseInt(t.p.iRow, 10) >= 0) {
3205
+ $("td:eq(" + t.p.iCol + ")", t.rows[t.p.iRow]).removeClass("edit-cell ui-state-highlight");
3206
+ $(t.rows[t.p.iRow]).removeClass("selected-row ui-state-hover");
3207
+ }
3208
+ }
3169
3209
  t.p.savedRow = [];
3170
3210
  });
3171
3211
  },
@@ -3382,19 +3422,17 @@
3382
3422
  row += "<td role=\"gridcell\" aria-describedby=\"" + t.p.id + "_" + nm + "\" " + prp + ">" + v + "</td>";
3383
3423
  }
3384
3424
  row = "<tr id=\"" + rowid + "\" role=\"row\" tabindex=\"-1\" class=\"ui-widget-content jqgrow ui-row-" + t.p.direction + " " + cna + "\">" + row + "</tr>";
3385
- if (t.p.subGrid === true) {
3386
- row = $(row)[0];
3387
- $(t).jqGrid("addSubGrid", row, gi + ni);
3388
- }
3389
3425
  if (t.rows.length === 0) {
3390
3426
  $("table:first", t.grid.bDiv).append(row);
3391
3427
  } else {
3392
3428
  switch (pos) {
3393
3429
  case 'last':
3394
3430
  $(t.rows[t.rows.length - 1]).after(row);
3431
+ sind = t.rows.length - 1;
3395
3432
  break;
3396
3433
  case 'first':
3397
3434
  $(t.rows[0]).after(row);
3435
+ sind = 1;
3398
3436
  break;
3399
3437
  case 'after':
3400
3438
  sind = t.rows.namedItem(src);
@@ -3406,6 +3444,7 @@
3406
3444
  $(sind).after(row);
3407
3445
  }
3408
3446
  }
3447
+ sind++;
3409
3448
  break;
3410
3449
  case 'before':
3411
3450
  sind = t.rows.namedItem(src);
@@ -3413,9 +3452,13 @@
3413
3452
  $(sind).before(row);
3414
3453
  sind = sind.rowIndex;
3415
3454
  }
3455
+ sind--;
3416
3456
  break;
3417
3457
  }
3418
3458
  }
3459
+ if (t.p.subGrid === true) {
3460
+ $(t).jqGrid("addSubGrid", gi + ni, sind);
3461
+ }
3419
3462
  t.p.records++;
3420
3463
  t.p.reccount++;
3421
3464
  if (air) {
@@ -3511,13 +3554,13 @@
3511
3554
  $(this.p.colModel).each(function(i) {
3512
3555
  if ($.inArray(this.name, colname) !== -1 && this.hidden === sw) {
3513
3556
  $("tr", $t.grid.hDiv).each(function() {
3514
- $(this).children("th:eq(" + i + ")").css("display", show);
3557
+ $(this.cells[i]).css("display", show);
3515
3558
  });
3516
3559
  $($t.rows).each(function(j) {
3517
- $(this).children("td:eq(" + i + ")").css("display", show);
3560
+ $(this.cells[i]).css("display", show);
3518
3561
  });
3519
3562
  if ($t.p.footerrow) {
3520
- $($t.grid.sDiv).children("td:eq(" + i + ")").css("display", show);
3563
+ $("tr.footrow td:eq(" + i + ")", $t.grid.sDiv).css("display", show);
3521
3564
  }
3522
3565
  cw = this.widthOrg ? this.widthOrg : parseInt(this.width, 10);
3523
3566
  if (show === "none") {
@@ -3530,17 +3573,7 @@
3530
3573
  }
3531
3574
  });
3532
3575
  if (fndh === true) {
3533
- if ($t.p.shrinkToFit === false) {
3534
- $('table:first', $t.grid.bDiv).css("width", $t.p.tblwidth + "px");
3535
- $('table:first', $t.grid.hDiv).css("width", $t.p.tblwidth + "px");
3536
- $t.grid.hDiv.scrollLeft = $t.grid.bDiv.scrollLeft;
3537
- if ($t.p.footerrow) {
3538
- $('table:first', $t.grid.sDiv).css("width", $t.p.tblwidth + "px");
3539
- }
3540
- }
3541
- else if ($t.grid.width !== $t.p.tblwidth) {
3542
- $($t).jqGrid("setGridWidth", $t.p.tblwidth);
3543
- }
3576
+ $($t).jqGrid("setGridWidth", $t.p.tblwidth);
3544
3577
  }
3545
3578
  });
3546
3579
  },
@@ -3690,6 +3723,11 @@
3690
3723
  lvc = i;
3691
3724
  }
3692
3725
  });
3726
+
3727
+ if (!lvc) {
3728
+ return;
3729
+ }
3730
+
3693
3731
  cr = 0;
3694
3732
  if (hs) {
3695
3733
  if (nwidth - gw - (initwidth + brd * vc) !== scw) {
@@ -3712,11 +3750,15 @@
3712
3750
  if (cle) {
3713
3751
  $t.grid.cols[lvc].style.width = cw + "px";
3714
3752
  }
3753
+ if ($t.p.footerrow) {
3754
+ $t.grid.footers[lvc].style.width = cw + "px";
3755
+ }
3756
+ }
3757
+ if ($t.p.tblwidth) {
3715
3758
  $('table:first', $t.grid.bDiv).css("width", $t.p.tblwidth + "px");
3716
3759
  $('table:first', $t.grid.hDiv).css("width", $t.p.tblwidth + "px");
3717
3760
  $t.grid.hDiv.scrollLeft = $t.grid.bDiv.scrollLeft;
3718
3761
  if ($t.p.footerrow) {
3719
- $t.grid.footers[lvc].style.width = cw + "px";
3720
3762
  $('table:first', $t.grid.sDiv).css("width", $t.p.tblwidth + "px");
3721
3763
  }
3722
3764
  }
@@ -3892,7 +3934,7 @@
3892
3934
  v = parseFloat(val);
3893
3935
  sum += v;
3894
3936
  min = Math.min(min, v);
3895
- max = Math.max(min, v);
3937
+ max = Math.max(max, v);
3896
3938
  }
3897
3939
  else if (obj) {
3898
3940
  ret.push({id:$t.rows[i].id,value:val});
@@ -3905,11 +3947,21 @@
3905
3947
  }
3906
3948
  if (mathopr) {
3907
3949
  switch (mathopr.toLowerCase()) {
3908
- case 'sum': ret = sum; break;
3909
- case 'avg': ret = sum / ln; break;
3910
- case 'count': ret = ln; break;
3911
- case 'min': ret = min; break;
3912
- case 'max': ret = max; break;
3950
+ case 'sum':
3951
+ ret = sum;
3952
+ break;
3953
+ case 'avg':
3954
+ ret = sum / ln;
3955
+ break;
3956
+ case 'count':
3957
+ ret = ln;
3958
+ break;
3959
+ case 'min':
3960
+ ret = min;
3961
+ break;
3962
+ case 'max':
3963
+ ret = max;
3964
+ break;
3913
3965
  }
3914
3966
  }
3915
3967
  }
@@ -3944,7 +3996,7 @@
3944
3996
  $t.p.lastpage = 0;
3945
3997
  $t.p.reccount = 0;
3946
3998
  $t.p.data = [];
3947
- $t.p_index = {};
3999
+ $t.p._index = {};
3948
4000
  $t.updatepager(true, false);
3949
4001
  });
3950
4002
  },
@@ -4035,19 +4087,19 @@
4035
4087
  o.onRightKey.call($t, $t.p.selrow);
4036
4088
  }
4037
4089
  }
4038
- return false;
4090
+ //return false;
4039
4091
  }
4040
4092
  //check if enter was pressed on a grid or treegrid node
4041
4093
  else if (event.keyCode === 13) {
4042
4094
  if ($.isFunction(o.onEnter)) {
4043
4095
  o.onEnter.call($t, $t.p.selrow);
4044
4096
  }
4045
- return false;
4097
+ //return false;
4046
4098
  } else if (event.keyCode === 32) {
4047
4099
  if ($.isFunction(o.onSpace)) {
4048
4100
  o.onSpace.call($t, $t.p.selrow);
4049
4101
  }
4050
- return false;
4102
+ //return false;
4051
4103
  }
4052
4104
  }
4053
4105
  });
@@ -4468,14 +4520,14 @@
4468
4520
  $.ajax($.extend({
4469
4521
  url: surl,
4470
4522
  dataType: "html",
4471
- complete: function(res, status) {
4523
+ success: function(res, status) {
4472
4524
  if (soptions.buildSelect !== undefined) {
4473
4525
  var d = soptions.buildSelect(res);
4474
4526
  if (d) {
4475
4527
  $(self).append(d);
4476
4528
  }
4477
4529
  } else {
4478
- $(self).append(res.responseText);
4530
+ $(self).append(res);
4479
4531
  }
4480
4532
  if (soptions.defaultValue) {
4481
4533
  $("select", self).val(soptions.defaultValue);
@@ -4953,6 +5005,9 @@ var xmlJsonClass = {
4953
5005
  xml += ind + "<" + name + ">" + "<![CDATA[" + v + "]]>" + "</" + name + ">";
4954
5006
  }
4955
5007
  else {
5008
+ if (v === undefined) {
5009
+ v = "";
5010
+ }
4956
5011
  if (v.toString() === "\"\"" || v.toString().length === 0) {
4957
5012
  xml += ind + "<" + name + ">__EMPTY_STRING_</" + name + ">";
4958
5013
  }
@@ -5353,12 +5408,9 @@ var xmlJsonClass = {
5353
5408
  if (format in opts.masks) {
5354
5409
  format = opts.masks[format];
5355
5410
  }
5356
- if (date.constructor === Number) {
5411
+ if (!isNaN(date - 0) && String(format).toLowerCase() == "u") {
5357
5412
  //Unix timestamp
5358
- if (String(format).toLowerCase() == "u") {
5359
- date = date * 1000;
5360
- }
5361
- timestamp = new Date(date);
5413
+ timestamp = new Date(parseFloat(date) * 1000);
5362
5414
  } else if (date.constructor === Date) {
5363
5415
  timestamp = date;
5364
5416
  // Microsoft date format support
@@ -5646,8 +5698,10 @@ var xmlJsonClass = {
5646
5698
  url: null,
5647
5699
  delOptions: {},
5648
5700
  editOptions : {}
5649
- },
5650
- cm = $('#' + gid)[0].p.colModel[pos];
5701
+ };
5702
+ rid = $.jgrid.jqID(rid);
5703
+ gid = $.jgrid.jqID(gid);
5704
+ var cm = $('#' + gid)[0].p.colModel[pos];
5651
5705
  if (!$.fmatter.isUndefined(cm.formatoptions)) {
5652
5706
  op = $.extend(op, cm.formatoptions);
5653
5707
  }
@@ -5659,31 +5713,31 @@ var xmlJsonClass = {
5659
5713
  }
5660
5714
  var saverow = function(rowid) {
5661
5715
  if (op.afterSave) op.afterSave(rowid);
5662
- $("tr#" + rid + " div.ui-inline-edit, " + "tr#" + rid + " div.ui-inline-del", "#" + gid).show();
5663
- $("tr#" + rid + " div.ui-inline-save, " + "tr#" + rid + " div.ui-inline-cancel", "#" + gid).hide();
5716
+ $("tr#" + rid + " div.ui-inline-edit, " + "tr#" + rid + " div.ui-inline-del", "#" + gid + ".ui-jqgrid-btable:first").show();
5717
+ $("tr#" + rid + " div.ui-inline-save, " + "tr#" + rid + " div.ui-inline-cancel", "#" + gid + ".ui-jqgrid-btable:first").hide();
5664
5718
  },
5665
5719
  restorerow = function(rowid) {
5666
5720
  if (op.afterRestore) op.afterRestore(rowid);
5667
- $("tr#" + rid + " div.ui-inline-edit, " + "tr#" + rid + " div.ui-inline-del", "#" + gid).show();
5668
- $("tr#" + rid + " div.ui-inline-save, " + "tr#" + rid + " div.ui-inline-cancel", "#" + gid).hide();
5721
+ $("tr#" + rid + " div.ui-inline-edit, " + "tr#" + rid + " div.ui-inline-del", "#" + gid + ".ui-jqgrid-btable:first").show();
5722
+ $("tr#" + rid + " div.ui-inline-save, " + "tr#" + rid + " div.ui-inline-cancel", "#" + gid + ".ui-jqgrid-btable:first").hide();
5669
5723
  };
5670
5724
 
5671
5725
  switch (act) {
5672
5726
  case 'edit':
5673
5727
  $('#' + gid).jqGrid('editRow', rid, op.keys, op.onEdit, op.onSuccess, op.url, op.extraparam, saverow, op.onError, restorerow);
5674
- $("tr#" + rid + " div.ui-inline-edit, " + "tr#" + rid + " div.ui-inline-del", "#" + gid).hide();
5675
- $("tr#" + rid + " div.ui-inline-save, " + "tr#" + rid + " div.ui-inline-cancel", "#" + gid).show();
5728
+ $("tr#" + rid + " div.ui-inline-edit, " + "tr#" + rid + " div.ui-inline-del", "#" + gid + ".ui-jqgrid-btable:first").hide();
5729
+ $("tr#" + rid + " div.ui-inline-save, " + "tr#" + rid + " div.ui-inline-cancel", "#" + gid + ".ui-jqgrid-btable:first").show();
5676
5730
  break;
5677
5731
  case 'save':
5678
5732
  if ($('#' + gid).jqGrid('saveRow', rid, op.onSuccess, op.url, op.extraparam, saverow, op.onError, restorerow)) {
5679
- $("tr#" + rid + " div.ui-inline-edit, " + "tr#" + rid + " div.ui-inline-del", "#" + gid).show();
5680
- $("tr#" + rid + " div.ui-inline-save, " + "tr#" + rid + " div.ui-inline-cancel", "#" + gid).hide();
5733
+ $("tr#" + rid + " div.ui-inline-edit, " + "tr#" + rid + " div.ui-inline-del", "#" + gid + ".ui-jqgrid-btable:first").show();
5734
+ $("tr#" + rid + " div.ui-inline-save, " + "tr#" + rid + " div.ui-inline-cancel", "#" + gid + ".ui-jqgrid-btable:first").hide();
5681
5735
  }
5682
5736
  break;
5683
5737
  case 'cancel' :
5684
5738
  $('#' + gid).jqGrid('restoreRow', rid, restorerow);
5685
- $("tr#" + rid + " div.ui-inline-edit, " + "tr#" + rid + " div.ui-inline-del", "#" + gid).show();
5686
- $("tr#" + rid + " div.ui-inline-save, " + "tr#" + rid + " div.ui-inline-cancel", "#" + gid).hide();
5739
+ $("tr#" + rid + " div.ui-inline-edit, " + "tr#" + rid + " div.ui-inline-del", "#" + gid + ".ui-jqgrid-btable:first").show();
5740
+ $("tr#" + rid + " div.ui-inline-save, " + "tr#" + rid + " div.ui-inline-cancel", "#" + gid + ".ui-jqgrid-btable:first").hide();
5687
5741
  break;
5688
5742
  case 'del':
5689
5743
  $('#' + gid).jqGrid('delGridRow', rid, op.delOptions);
@@ -5704,21 +5758,21 @@ var xmlJsonClass = {
5704
5758
  return "";
5705
5759
  }
5706
5760
  if (op.editformbutton) {
5707
- ocl = "onclick=$.fn.fmatter.rowactions('" + rowid + "','" + opts.gid + "','formedit'," + opts.pos + "); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); "
5708
- str = str + "<div style='margin-left:8px;'><div title='" + $.jgrid.nav.edittitle + "' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' " + ocl + "><span class='ui-icon ui-icon-pencil'></span></div>";
5761
+ ocl = "onclick=jQuery.fn.fmatter.rowactions('" + rowid + "','" + opts.gid + "','formedit'," + opts.pos + "); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); "
5762
+ str = str + "<div title='" + $.jgrid.nav.edittitle + "' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' " + ocl + "><span class='ui-icon ui-icon-pencil'></span></div>";
5709
5763
  } else if (op.editbutton) {
5710
- ocl = "onclick=$.fn.fmatter.rowactions('" + rowid + "','" + opts.gid + "','edit'," + opts.pos + "); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover') ";
5711
- str = str + "<div style='margin-left:8px;'><div title='" + $.jgrid.nav.edittitle + "' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' " + ocl + "><span class='ui-icon ui-icon-pencil'></span></div>";
5764
+ ocl = "onclick=jQuery.fn.fmatter.rowactions('" + rowid + "','" + opts.gid + "','edit'," + opts.pos + "); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover') ";
5765
+ str = str + "<div title='" + $.jgrid.nav.edittitle + "' style='float:left;cursor:pointer;' class='ui-pg-div ui-inline-edit' " + ocl + "><span class='ui-icon ui-icon-pencil'></span></div>";
5712
5766
  }
5713
5767
  if (op.delbutton) {
5714
- ocl = "onclick=$.fn.fmatter.rowactions('" + rowid + "','" + opts.gid + "','del'," + opts.pos + "); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
5768
+ ocl = "onclick=jQuery.fn.fmatter.rowactions('" + rowid + "','" + opts.gid + "','del'," + opts.pos + "); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
5715
5769
  str = str + "<div title='" + $.jgrid.nav.deltitle + "' style='float:left;margin-left:5px;' class='ui-pg-div ui-inline-del' " + ocl + "><span class='ui-icon ui-icon-trash'></span></div>";
5716
5770
  }
5717
- ocl = "onclick=$.fn.fmatter.rowactions('" + rowid + "','" + opts.gid + "','save'," + opts.pos + "); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
5718
- str = str + "<div title='" + $.jgrid.edit.bSubmit + "' style='float:left;display:none' class='ui-pg-div ui-inline-save'><span class='ui-icon ui-icon-disk' " + ocl + "></span></div>";
5719
- ocl = "onclick=$.fn.fmatter.rowactions('" + rowid + "','" + opts.gid + "','cancel'," + opts.pos + "); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
5720
- str = str + "<div title='" + $.jgrid.edit.bCancel + "' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel'><span class='ui-icon ui-icon-cancel' " + ocl + "></span></div></div>";
5721
- return str;
5771
+ ocl = "onclick=jQuery.fn.fmatter.rowactions('" + rowid + "','" + opts.gid + "','save'," + opts.pos + "); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
5772
+ str = str + "<div title='" + $.jgrid.edit.bSubmit + "' style='float:left;display:none' class='ui-pg-div ui-inline-save' " + ocl + "><span class='ui-icon ui-icon-disk'></span></div>";
5773
+ ocl = "onclick=jQuery.fn.fmatter.rowactions('" + rowid + "','" + opts.gid + "','cancel'," + opts.pos + "); onmouseover=jQuery(this).addClass('ui-state-hover'); onmouseout=jQuery(this).removeClass('ui-state-hover'); ";
5774
+ str = str + "<div title='" + $.jgrid.edit.bCancel + "' style='float:left;display:none;margin-left:5px;' class='ui-pg-div ui-inline-cancel' " + ocl + "><span class='ui-icon ui-icon-cancel'></span></div>";
5775
+ return "<div style='margin-left:8px;'>" + str + "</div>";
5722
5776
  };
5723
5777
  $.unformat = function (cellval, options, pos, cnt) {
5724
5778
  // specific for jqGrid only
@@ -5762,7 +5816,7 @@ var xmlJsonClass = {
5762
5816
  ret = $(cellval).text();
5763
5817
  }
5764
5818
  }
5765
- return ret ? ret : cnt === true ? $(cellval).text() : $.jgrid.htmlDecode($(cellval).html());
5819
+ return ret !== undefined ? ret : cnt === true ? $(cellval).text() : $.jgrid.htmlDecode($(cellval).html());
5766
5820
  };
5767
5821
  $.unformat.select = function (cellval, options, pos, cnt) {
5768
5822
  // Spacial case when we have local data and perform a sort
@@ -5840,6 +5894,7 @@ var xmlJsonClass = {
5840
5894
  };
5841
5895
  })(jQuery);
5842
5896
 
5897
+
5843
5898
  ;
5844
5899
  (function($) {
5845
5900
  /*
@@ -5907,8 +5962,8 @@ var xmlJsonClass = {
5907
5962
  $(mh).append("<span class='ui-jqdialog-title'>" + p.caption + "</span>");
5908
5963
  var ahr = $("<a href='javascript:void(0)' class='ui-jqdialog-titlebar-close ui-corner-all'></a>")
5909
5964
  .hover(function() {
5910
- ahr.addClass('ui-state-hover');
5911
- },
5965
+ ahr.addClass('ui-state-hover');
5966
+ },
5912
5967
  function() {
5913
5968
  ahr.removeClass('ui-state-hover');
5914
5969
  })
@@ -6032,6 +6087,7 @@ var xmlJsonClass = {
6032
6087
  toTop: true,
6033
6088
  overlay: 10,
6034
6089
  modal: false,
6090
+ overlayClass : 'ui-widget-overlay',
6035
6091
  onShow: this.showModal,
6036
6092
  onHide: this.closeModal,
6037
6093
  gbox: '',
@@ -6109,14 +6165,14 @@ var xmlJsonClass = {
6109
6165
  } catch (e) {
6110
6166
  }
6111
6167
  this.createModal({
6112
- themodal:'info_dialog',
6113
- modalhead:'info_head',
6114
- modalcontent:'info_content',
6115
- scrollelm: 'infocnt'},
6168
+ themodal:'info_dialog',
6169
+ modalhead:'info_head',
6170
+ modalcontent:'info_content',
6171
+ scrollelm: 'infocnt'},
6116
6172
  cnt,
6117
6173
  mopt,
6118
6174
  '', '', true
6119
- );
6175
+ );
6120
6176
  // attach onclick after inserting into the dom
6121
6177
  if (buttstr) {
6122
6178
  $.each(mopt.buttons, function(i) {
@@ -6137,7 +6193,7 @@ var xmlJsonClass = {
6137
6193
  function() {
6138
6194
  $(this).removeClass('ui-state-hover');
6139
6195
  }
6140
- );
6196
+ );
6141
6197
  if ($.isFunction(mopt.beforeOpen)) {
6142
6198
  mopt.beforeOpen();
6143
6199
  }
@@ -6298,16 +6354,14 @@ var xmlJsonClass = {
6298
6354
  }, ajaxso || {}));
6299
6355
  } else if (options.value) {
6300
6356
  var i;
6357
+ if (typeof options.size === 'undefined') {
6358
+ options.size = msl ? 3 : 1;
6359
+ }
6301
6360
  if (msl) {
6302
6361
  ovm = vl.split(",");
6303
6362
  ovm = $.map(ovm, function(n) {
6304
6363
  return $.trim(n);
6305
6364
  });
6306
- if (typeof options.size === 'undefined') {
6307
- options.size = 3;
6308
- }
6309
- } else {
6310
- options.size = 1;
6311
6365
  }
6312
6366
  if (typeof options.value === 'function') {
6313
6367
  options.value = options.value();
@@ -6319,8 +6373,8 @@ var xmlJsonClass = {
6319
6373
  sv = so[i].split(":");
6320
6374
  if (sv.length > 2) {
6321
6375
  sv[1] = $.map(sv,
6322
- function(n, i) {
6323
- if (i > 0) {
6376
+ function(n, ii) {
6377
+ if (ii > 0) {
6324
6378
  return n;
6325
6379
  }
6326
6380
  }).join(":");
@@ -6329,13 +6383,13 @@ var xmlJsonClass = {
6329
6383
  ov.setAttribute("role", "option");
6330
6384
  ov.value = sv[0];
6331
6385
  ov.innerHTML = sv[1];
6386
+ elem.appendChild(ov);
6332
6387
  if (!msl && ($.trim(sv[0]) == $.trim(vl) || $.trim(sv[1]) == $.trim(vl))) {
6333
6388
  ov.selected = "selected";
6334
6389
  }
6335
6390
  if (msl && ($.inArray($.trim(sv[1]), ovm) > -1 || $.inArray($.trim(sv[0]), ovm) > -1)) {
6336
6391
  ov.selected = "selected";
6337
6392
  }
6338
- elem.appendChild(ov);
6339
6393
  }
6340
6394
  } else if (typeof options.value === 'object') {
6341
6395
  var oSv = options.value;
@@ -6345,13 +6399,13 @@ var xmlJsonClass = {
6345
6399
  ov.setAttribute("role", "option");
6346
6400
  ov.value = key;
6347
6401
  ov.innerHTML = oSv[key];
6402
+ elem.appendChild(ov);
6348
6403
  if (!msl && ( $.trim(key) == $.trim(vl) || $.trim(oSv[key]) == $.trim(vl))) {
6349
6404
  ov.selected = "selected";
6350
6405
  }
6351
6406
  if (msl && ($.inArray($.trim(oSv[key]), ovm) > -1 || $.inArray($.trim(key), ovm) > -1)) {
6352
6407
  ov.selected = "selected";
6353
6408
  }
6354
- elem.appendChild(ov);
6355
6409
  }
6356
6410
  }
6357
6411
  }
@@ -6705,6 +6759,7 @@ var xmlJsonClass = {
6705
6759
  filter: null,
6706
6760
  columns: [],
6707
6761
  onChange : null,
6762
+ afterRedraw : null,
6708
6763
  checkValues : null,
6709
6764
  error: false,
6710
6765
  errmsg : "",
@@ -6733,7 +6788,8 @@ var xmlJsonClass = {
6733
6788
  stropts : ['eq', 'ne', 'bw', 'bn', 'ew', 'en', 'cn', 'nc', 'nu', 'nn', 'in', 'ni'],
6734
6789
  _gridsopt : [], // grid translated strings, do not tuch
6735
6790
  groupOps : ["AND", "OR"],
6736
- groupButton : true
6791
+ groupButton : true,
6792
+ ruleButtons : true
6737
6793
  }, arg || {});
6738
6794
  return this.each(function() {
6739
6795
  if (this.filter) {
@@ -6831,13 +6887,16 @@ var xmlJsonClass = {
6831
6887
  return $.isFunction(this.p.onChange) ? this.p.onChange.call(this, this.p) : false;
6832
6888
  };
6833
6889
  /*
6834
- * Redrow the filter every time when new field is added/deleted
6890
+ * Redraw the filter every time when new field is added/deleted
6835
6891
  * and field is changed
6836
6892
  */
6837
6893
  this.reDraw = function() {
6838
6894
  $("table.group:first", this).remove();
6839
6895
  var t = this.createTableForGroup(p.filter, null);
6840
6896
  $(this).append(t);
6897
+ if ($.isFunction(this.p.afterRedraw)) {
6898
+ this.p.afterRedraw.call(this, this.p);
6899
+ }
6841
6900
  };
6842
6901
  /*
6843
6902
  * Creates a grouping data for the filter
@@ -6861,23 +6920,24 @@ var xmlJsonClass = {
6861
6920
  var th = $("<th colspan='5' align='left'></th>");
6862
6921
  tr.append(th);
6863
6922
 
6864
- // dropdown for: choosing group operator type
6865
- var groupOpSelect = $("<select class='opsel'></select>");
6866
- th.append(groupOpSelect);
6867
- // populate dropdown with all posible group operators: or, and
6868
- var str = "", selected;
6869
- for (i = 0; i < p.groupOps.length; i++) {
6870
- selected = group.groupOp === that.p.groupOps[i] ? " selected='selected'" : "";
6871
- str += "<option value='" + that.p.groupOps[i] + "'" + selected + ">" + that.p.groupOps[i] + "</option>";
6923
+ if (this.p.ruleButtons === true) {
6924
+ // dropdown for: choosing group operator type
6925
+ var groupOpSelect = $("<select class='opsel'></select>");
6926
+ th.append(groupOpSelect);
6927
+ // populate dropdown with all posible group operators: or, and
6928
+ var str = "", selected;
6929
+ for (i = 0; i < p.groupOps.length; i++) {
6930
+ selected = group.groupOp === that.p.groupOps[i] ? " selected='selected'" : "";
6931
+ str += "<option value='" + that.p.groupOps[i] + "'" + selected + ">" + that.p.groupOps[i] + "</option>";
6932
+ }
6933
+
6934
+ groupOpSelect
6935
+ .append(str)
6936
+ .bind('change', function() {
6937
+ group.groupOp = $(groupOpSelect).val();
6938
+ that.onchange(); // signals that the filter has changed
6939
+ });
6872
6940
  }
6873
-
6874
- groupOpSelect
6875
- .append(str)
6876
- .bind('change', function() {
6877
- group.groupOp = $(groupOpSelect).val();
6878
- that.onchange(); // signals that the filter has changed
6879
- });
6880
-
6881
6941
  // button for adding a new subgroup
6882
6942
  var inputAddSubgroup = "<span></span>";
6883
6943
  if (this.p.groupButton) {
@@ -6900,50 +6960,51 @@ var xmlJsonClass = {
6900
6960
  });
6901
6961
  }
6902
6962
  th.append(inputAddSubgroup);
6903
-
6904
- // button for adding a new rule
6905
- var inputAddRule = $("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>"), cm;
6906
- inputAddRule.bind('click', function() {
6907
- //if(!group) { group = {};}
6908
- if (group.rules === undefined) {
6909
- group.rules = [];
6910
- }
6911
- for (i = 0; i < that.p.columns.length; i++) {
6912
- // but show only serchable and serchhidden = true fields
6913
- var searchable = (typeof that.p.columns[i].search === 'undefined') ? true : that.p.columns[i].search ,
6914
- hidden = (that.p.columns[i].hidden === true),
6915
- ignoreHiding = (that.p.columns[i].searchoptions.searchhidden === true);
6916
- if ((ignoreHiding && searchable) || (searchable && !hidden)) {
6917
- cm = that.p.columns[i];
6918
- break;
6963
+ if (this.p.ruleButtons === true) {
6964
+ // button for adding a new rule
6965
+ var inputAddRule = $("<input type='button' value='+' title='Add rule' class='add-rule ui-add'/>"), cm;
6966
+ inputAddRule.bind('click', function() {
6967
+ //if(!group) { group = {};}
6968
+ if (group.rules === undefined) {
6969
+ group.rules = [];
6970
+ }
6971
+ for (i = 0; i < that.p.columns.length; i++) {
6972
+ // but show only serchable and serchhidden = true fields
6973
+ var searchable = (typeof that.p.columns[i].search === 'undefined') ? true : that.p.columns[i].search ,
6974
+ hidden = (that.p.columns[i].hidden === true),
6975
+ ignoreHiding = (that.p.columns[i].searchoptions.searchhidden === true);
6976
+ if ((ignoreHiding && searchable) || (searchable && !hidden)) {
6977
+ cm = that.p.columns[i];
6978
+ break;
6979
+ }
6980
+ }
6981
+ var opr;
6982
+ if (cm.searchoptions.sopt) {
6983
+ opr = cm.searchoptions.sopt;
6984
+ }
6985
+ else if (that.p.sopt) {
6986
+ opr = that.p.sopt;
6987
+ }
6988
+ else if (cm.searchtype === 'string') {
6989
+ opr = that.p.stropts;
6990
+ }
6991
+ else {
6992
+ opr = that.p.numopts;
6919
6993
  }
6920
- }
6921
- var opr;
6922
- if (cm.searchoptions.sopt) {
6923
- opr = cm.searchoptions.sopt;
6924
- }
6925
- else if (that.p.sopt) {
6926
- opr = that.p.sopt;
6927
- }
6928
- else if (cm.searchtype === 'string') {
6929
- opr = that.p.stropts;
6930
- }
6931
- else {
6932
- opr = that.p.numopts;
6933
- }
6934
6994
 
6935
- group.rules.push({
6936
- field: cm.name,
6937
- op: opr[0],
6938
- data: ""
6939
- }); // adding a new rule
6995
+ group.rules.push({
6996
+ field: cm.name,
6997
+ op: opr[0],
6998
+ data: ""
6999
+ }); // adding a new rule
6940
7000
 
6941
- that.reDraw(); // the html has changed, force reDraw
6942
- // for the moment no change have been made to the rule, so
6943
- // this will not trigger onchange event
6944
- return false;
6945
- });
6946
- th.append(inputAddRule);
7001
+ that.reDraw(); // the html has changed, force reDraw
7002
+ // for the moment no change have been made to the rule, so
7003
+ // this will not trigger onchange event
7004
+ return false;
7005
+ });
7006
+ th.append(inputAddRule);
7007
+ }
6947
7008
 
6948
7009
  // button for delete the group
6949
7010
  if (parentgroup !== null) { // ignore the first group
@@ -6988,7 +7049,7 @@ var xmlJsonClass = {
6988
7049
  for (i = 0; i < group.rules.length; i++) {
6989
7050
  table.append(
6990
7051
  this.createTableRowForRule(group.rules[i], group)
6991
- );
7052
+ );
6992
7053
  }
6993
7054
  }
6994
7055
 
@@ -7055,7 +7116,7 @@ var xmlJsonClass = {
7055
7116
  op = that.p.numopts;
7056
7117
  }
7057
7118
  // operators
7058
- var s = "",so = "";
7119
+ var s = "", so = 0;
7059
7120
  aoprs = [];
7060
7121
  $.each(that.p.ops, function() {
7061
7122
  aoprs.push(this.name)
@@ -7063,16 +7124,20 @@ var xmlJsonClass = {
7063
7124
  for (i = 0; i < op.length; i++) {
7064
7125
  ina = $.inArray(op[i], aoprs);
7065
7126
  if (ina !== -1) {
7066
- so = "";
7067
- if (i === 0) {
7127
+ if (so === 0) {
7068
7128
  rule.op = that.p.ops[ina].name;
7069
- so = " selected='selected'";
7070
7129
  }
7071
- s += "<option value='" + that.p.ops[ina].name + "'" + so + ">" + that.p.ops[ina].description + "</option>";
7130
+ s += "<option value='" + that.p.ops[ina].name + "'>" + that.p.ops[ina].description + "</option>";
7131
+ so++;
7072
7132
  }
7073
7133
  }
7074
7134
  $(".selectopts", trpar).empty().append(s);
7075
-
7135
+ $(".selectopts", trpar)[0].selectedIndex = 0;
7136
+ if ($.browser.msie && $.browser.version < 9) {
7137
+ var sw = parseInt($("select.selectopts", trpar)[0].offsetWidth) + 1;
7138
+ $(".selectopts", trpar).width(sw);
7139
+ $(".selectopts", trpar).css("width", "auto");
7140
+ }
7076
7141
  // data
7077
7142
  $(".data", trpar).empty().append(elm);
7078
7143
  $(".input-elm", trpar).bind('change', function() {
@@ -7175,33 +7240,34 @@ var xmlJsonClass = {
7175
7240
  $(ruleDataInput)
7176
7241
  .addClass("input-elm")
7177
7242
  .bind('change', function() {
7178
- rule.data = $(this).val();
7179
- that.onchange(); // signals that the filter has changed
7180
- });
7243
+ rule.data = $(this).val();
7244
+ that.onchange(); // signals that the filter has changed
7245
+ });
7181
7246
 
7182
7247
  // create action container
7183
7248
  var ruleDeleteTd = $("<td></td>");
7184
7249
  tr.append(ruleDeleteTd);
7185
7250
 
7186
7251
  // create button for: delete rule
7187
- var ruleDeleteInput = $("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>");
7188
- ruleDeleteTd.append(ruleDeleteInput);
7189
- //$(ruleDeleteInput).html("").height(20).width(30).button({icons: { primary: "ui-icon-minus", text:false}});
7190
- ruleDeleteInput.bind('click', function() {
7191
- // remove rule from group
7192
- for (i = 0; i < group.rules.length; i++) {
7193
- if (group.rules[i] === rule) {
7194
- group.rules.splice(i, 1);
7195
- break;
7252
+ if (this.p.ruleButtons === true) {
7253
+ var ruleDeleteInput = $("<input type='button' value='-' title='Delete rule' class='delete-rule ui-del'/>");
7254
+ ruleDeleteTd.append(ruleDeleteInput);
7255
+ //$(ruleDeleteInput).html("").height(20).width(30).button({icons: { primary: "ui-icon-minus", text:false}});
7256
+ ruleDeleteInput.bind('click', function() {
7257
+ // remove rule from group
7258
+ for (i = 0; i < group.rules.length; i++) {
7259
+ if (group.rules[i] === rule) {
7260
+ group.rules.splice(i, 1);
7261
+ break;
7262
+ }
7196
7263
  }
7197
- }
7198
7264
 
7199
- that.reDraw(); // the html has changed, force reDraw
7200
-
7201
- that.onchange(); // signals that the filter has changed
7202
- return false;
7203
- });
7265
+ that.reDraw(); // the html has changed, force reDraw
7204
7266
 
7267
+ that.onchange(); // signals that the filter has changed
7268
+ return false;
7269
+ });
7270
+ }
7205
7271
  return tr;
7206
7272
  };
7207
7273
 
@@ -7430,7 +7496,7 @@ var xmlJsonClass = {
7430
7496
  * http://www.gnu.org/licenses/gpl-2.0.html
7431
7497
  **/
7432
7498
  /*global xmlJsonClass, jQuery, $ */
7433
- var rp_ge = null;
7499
+ var rp_ge = {};
7434
7500
  $.jgrid.extend({
7435
7501
  searchGrid : function (p) {
7436
7502
  p = $.extend({
@@ -7444,6 +7510,7 @@ var xmlJsonClass = {
7444
7510
  beforeShowSearch: null,
7445
7511
  afterShowSearch : null,
7446
7512
  onInitializeSearch: null,
7513
+ afterRedraw : null,
7447
7514
  closeAfterSearch : false,
7448
7515
  closeAfterReset: false,
7449
7516
  closeOnEscape : false,
@@ -7454,7 +7521,7 @@ var xmlJsonClass = {
7454
7521
  left: 0,
7455
7522
  jqModal : true,
7456
7523
  modal: false,
7457
- resize : false,
7524
+ resize : true,
7458
7525
  width: 450,
7459
7526
  height: 'auto',
7460
7527
  dataheight: 'auto',
@@ -7469,7 +7536,7 @@ var xmlJsonClass = {
7469
7536
  onSearch : null,
7470
7537
  onReset : null,
7471
7538
  toTop : true,
7472
- overlay : 10,
7539
+ overlay : 30,
7473
7540
  columns : [],
7474
7541
  tmplNames : null,
7475
7542
  tmplFilters : null,
@@ -7508,12 +7575,6 @@ var xmlJsonClass = {
7508
7575
  }
7509
7576
  }
7510
7577
 
7511
- function hideButtons() {
7512
- $(".add-rule", "#" + fid).hide();
7513
- $(".delete-rule", "#" + fid).hide();
7514
- $(".opsel", "#" + fid).hide();
7515
- }
7516
-
7517
7578
  if ($("#" + IDs.themodal).html() !== null) {
7518
7579
  showFilter();
7519
7580
  } else {
@@ -7581,6 +7642,8 @@ var xmlJsonClass = {
7581
7642
  errorcheck : p.errorcheck,
7582
7643
  sopt: p.sopt,
7583
7644
  groupButton : p.multipleGroup,
7645
+ ruleButtons : p.multipleSearch,
7646
+ afterRedraw : p.afterRedraw,
7584
7647
  _gridsopt : $.jgrid.search.odata,
7585
7648
  onChange : function(sp) {
7586
7649
  if (this.p.showQuery) {
@@ -7600,9 +7663,7 @@ var xmlJsonClass = {
7600
7663
  return false;
7601
7664
  });
7602
7665
  }
7603
- if (p.multipleSearch === false) {
7604
- hideButtons();
7605
- }
7666
+ if (p.multipleGroup === true) p.multipleSearch = true;
7606
7667
  if ($.isFunction(p.onInitializeSearch)) {
7607
7668
  p.onInitializeSearch($("#" + fid));
7608
7669
  }
@@ -7694,9 +7755,6 @@ var xmlJsonClass = {
7694
7755
  if ($.isFunction(p.onReset)) {
7695
7756
  p.onReset();
7696
7757
  }
7697
- if (p.multipleSearch === false) {
7698
- hideButtons();
7699
- }
7700
7758
  $($t).trigger("reloadGrid", [
7701
7759
  {page:1}
7702
7760
  ]);
@@ -7710,7 +7768,7 @@ var xmlJsonClass = {
7710
7768
  function() {
7711
7769
  $(this).removeClass('ui-state-hover');
7712
7770
  }
7713
- );
7771
+ );
7714
7772
  }
7715
7773
  });
7716
7774
  },
@@ -7722,7 +7780,7 @@ var xmlJsonClass = {
7722
7780
  height: 'auto',
7723
7781
  dataheight: 'auto',
7724
7782
  modal: false,
7725
- overlay : 10,
7783
+ overlay : 30,
7726
7784
  drag: true,
7727
7785
  resize: true,
7728
7786
  url: null,
@@ -7760,7 +7818,7 @@ var xmlJsonClass = {
7760
7818
  serializeEditData : null,
7761
7819
  viewPagerButtons : true
7762
7820
  }, $.jgrid.edit, p || {});
7763
- rp_ge = p;
7821
+ rp_ge[$(this)[0].p.id] = p;
7764
7822
  return this.each(function() {
7765
7823
  var $t = this;
7766
7824
  if (!$t.grid || !rowid) {
@@ -7769,18 +7827,18 @@ var xmlJsonClass = {
7769
7827
  var gID = $t.p.id,
7770
7828
  frmgr = "FrmGrid_" + gID,frmtb = "TblGrid_" + gID,
7771
7829
  IDs = {themodal:'editmod' + gID,modalhead:'edithd' + gID,modalcontent:'editcnt' + gID, scrollelm : frmgr},
7772
- onBeforeShow = $.isFunction(rp_ge.beforeShowForm) ? rp_ge.beforeShowForm : false,
7773
- onAfterShow = $.isFunction(rp_ge.afterShowForm) ? rp_ge.afterShowForm : false,
7774
- onBeforeInit = $.isFunction(rp_ge.beforeInitData) ? rp_ge.beforeInitData : false,
7775
- onInitializeForm = $.isFunction(rp_ge.onInitializeForm) ? rp_ge.onInitializeForm : false,
7830
+ onBeforeShow = $.isFunction(rp_ge[$t.p.id].beforeShowForm) ? rp_ge[$t.p.id].beforeShowForm : false,
7831
+ onAfterShow = $.isFunction(rp_ge[$t.p.id].afterShowForm) ? rp_ge[$t.p.id].afterShowForm : false,
7832
+ onBeforeInit = $.isFunction(rp_ge[$t.p.id].beforeInitData) ? rp_ge[$t.p.id].beforeInitData : false,
7833
+ onInitializeForm = $.isFunction(rp_ge[$t.p.id].onInitializeForm) ? rp_ge[$t.p.id].onInitializeForm : false,
7776
7834
  copydata = null,
7777
7835
  showFrm = true,
7778
7836
  maxCols = 1, maxRows = 0, postdata, extpost, newData, diff;
7779
7837
  if (rowid === "new") {
7780
7838
  rowid = "_empty";
7781
- p.caption = rp_ge.addCaption;
7839
+ p.caption = rp_ge[$t.p.id].addCaption;
7782
7840
  } else {
7783
- p.caption = rp_ge.editCaption;
7841
+ p.caption = rp_ge[$t.p.id].editCaption;
7784
7842
  }
7785
7843
  if (p.recreateForm === true && $("#" + IDs.themodal).html() !== null) {
7786
7844
  $("#" + IDs.themodal).remove();
@@ -7790,7 +7848,7 @@ var xmlJsonClass = {
7790
7848
  closeovrl = false;
7791
7849
  }
7792
7850
  function getFormData() {
7793
- $(".FormElement", "#" + frmtb).each(function(i) {
7851
+ $("#" + frmtb + " > tbody > tr > td > .FormElement").each(function(i) {
7794
7852
  var celm = $(".customelement", this);
7795
7853
  if (celm.length) {
7796
7854
  var elem = celm[0], nm = $(elem).attr('name');
@@ -7839,7 +7897,7 @@ var xmlJsonClass = {
7839
7897
  function(i, selected) {
7840
7898
  selectedText[i] = $(selected).text();
7841
7899
  }
7842
- );
7900
+ );
7843
7901
  extpost[this.name] = selectedText.join(",");
7844
7902
  break;
7845
7903
  case "password":
@@ -7888,7 +7946,7 @@ var xmlJsonClass = {
7888
7946
  } catch (_) {
7889
7947
  tmp = (this.edittype && this.edittype == "textarea") ? $("td:eq(" + i + ")", obj.rows[ind]).text() : $("td:eq(" + i + ")", obj.rows[ind]).html();
7890
7948
  }
7891
- if (tmp == "&nbsp;" || tmp == "&#160;" || (tmp.length == 1 && tmp.charCodeAt(0) == 160)) {
7949
+ if (!tmp || tmp == "&nbsp;" || tmp == "&#160;" || (tmp.length == 1 && tmp.charCodeAt(0) == 160)) {
7892
7950
  tmp = '';
7893
7951
  }
7894
7952
  }
@@ -7913,8 +7971,8 @@ var xmlJsonClass = {
7913
7971
  if (tmp === "" && this.edittype == "select") {
7914
7972
  tmp = $("option:eq(0)", elc).text();
7915
7973
  }
7916
- if (rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
7917
- rp_ge._savedData[nm] = tmp;
7974
+ if (rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {
7975
+ rp_ge[$t.p.id]._savedData[nm] = tmp;
7918
7976
  }
7919
7977
  $(elc).addClass("FormElement");
7920
7978
  if (this.edittype == 'text' || this.edittype == 'textarea') {
@@ -7942,8 +8000,8 @@ var xmlJsonClass = {
7942
8000
  var idrow = $("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='" + (maxcols * 2 - 1) + "' class='DataTD'><input class='FormElement' id='id_g' type='text' name='" + obj.p.id + "_id' value='" + rowid + "'/></td></tr>");
7943
8001
  idrow[0].rp = cnt + 999;
7944
8002
  $(tb).append(idrow);
7945
- if (rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
7946
- rp_ge._savedData[obj.p.id + "_id"] = rowid;
8003
+ if (rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {
8004
+ rp_ge[$t.p.id]._savedData[obj.p.id + "_id"] = rowid;
7947
8005
  }
7948
8006
  }
7949
8007
  return retpos;
@@ -7951,9 +8009,9 @@ var xmlJsonClass = {
7951
8009
 
7952
8010
  function fillData(rowid, obj, fmid) {
7953
8011
  var nm,cnt = 0,tmp, fld,opt,vl,vlc;
7954
- if (rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
7955
- rp_ge._savedData = {};
7956
- rp_ge._savedData[obj.p.id + "_id"] = rowid;
8012
+ if (rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {
8013
+ rp_ge[$t.p.id]._savedData = {};
8014
+ rp_ge[$t.p.id]._savedData[obj.p.id + "_id"] = rowid;
7957
8015
  }
7958
8016
  var cm = obj.p.colModel;
7959
8017
  if (rowid == '_empty') {
@@ -7988,8 +8046,8 @@ var xmlJsonClass = {
7988
8046
  fld.val(vl);
7989
8047
  }
7990
8048
  }
7991
- if (rp_ge.checkOnSubmit === true || rp_ge.checkOnUpdate) {
7992
- rp_ge._savedData[nm] = vl;
8049
+ if (rp_ge[$t.p.id].checkOnSubmit === true || rp_ge[$t.p.id].checkOnUpdate) {
8050
+ rp_ge[$t.p.id]._savedData[nm] = vl;
7993
8051
  }
7994
8052
  }
7995
8053
  });
@@ -8016,8 +8074,8 @@ var xmlJsonClass = {
8016
8074
  if ($t.p.autoencode) {
8017
8075
  tmp = $.jgrid.htmlDecode(tmp);
8018
8076
  }
8019
- if (rp_ge.checkOnSubmit === true || rp_ge.checkOnUpdate) {
8020
- rp_ge._savedData[nm] = tmp;
8077
+ if (rp_ge[$t.p.id].checkOnSubmit === true || rp_ge[$t.p.id].checkOnUpdate) {
8078
+ rp_ge[$t.p.id]._savedData[nm] = tmp;
8021
8079
  }
8022
8080
  nm = $.jgrid.jqID(nm);
8023
8081
  switch (cm[i].edittype) {
@@ -8037,7 +8095,7 @@ var xmlJsonClass = {
8037
8095
  return $.trim(n);
8038
8096
  });
8039
8097
  $("#" + nm + " option", "#" + fmid).each(function(j) {
8040
- if (!cm[i].editoptions.multiple && (opv[0] == $.trim($(this).text()) || opv[0] == $.trim($(this).val()))) {
8098
+ if (!cm[i].editoptions.multiple && ($.trim(tmp) == $.trim($(this).text()) || opv[0] == $.trim($(this).text()) || opv[0] == $.trim($(this).val()))) {
8041
8099
  this.selected = true;
8042
8100
  } else if (cm[i].editoptions.multiple) {
8043
8101
  if ($.inArray($.trim($(this).text()), opv) > -1 || $.inArray($.trim($(this).val()), opv) > -1) {
@@ -8099,8 +8157,8 @@ var xmlJsonClass = {
8099
8157
 
8100
8158
  function postIt() {
8101
8159
  var copydata, ret = [true,"",""], onCS = {}, opers = $t.p.prmNames, idname, oper, key, selr;
8102
- if ($.isFunction(rp_ge.beforeCheckValues)) {
8103
- var retvals = rp_ge.beforeCheckValues(postdata, $("#" + frmgr), postdata[$t.p.id + "_id"] == "_empty" ? opers.addoper : opers.editoper);
8160
+ if ($.isFunction(rp_ge[$t.p.id].beforeCheckValues)) {
8161
+ var retvals = rp_ge[$t.p.id].beforeCheckValues(postdata, $("#" + frmgr), postdata[$t.p.id + "_id"] == "_empty" ? opers.addoper : opers.editoper);
8104
8162
  if (retvals && typeof(retvals) === 'object') {
8105
8163
  postdata = retvals;
8106
8164
  }
@@ -8113,17 +8171,18 @@ var xmlJsonClass = {
8113
8171
  }
8114
8172
  }
8115
8173
  }
8174
+ setNulls();
8116
8175
  if (ret[0]) {
8117
- if ($.isFunction(rp_ge.onclickSubmit)) {
8118
- onCS = rp_ge.onclickSubmit(rp_ge, postdata) || {};
8176
+ if ($.isFunction(rp_ge[$t.p.id].onclickSubmit)) {
8177
+ onCS = rp_ge[$t.p.id].onclickSubmit(rp_ge[$t.p.id], postdata) || {};
8119
8178
  }
8120
- if ($.isFunction(rp_ge.beforeSubmit)) {
8121
- ret = rp_ge.beforeSubmit(postdata, $("#" + frmgr));
8179
+ if ($.isFunction(rp_ge[$t.p.id].beforeSubmit)) {
8180
+ ret = rp_ge[$t.p.id].beforeSubmit(postdata, $("#" + frmgr));
8122
8181
  }
8123
8182
  }
8124
8183
 
8125
- if (ret[0] && !rp_ge.processing) {
8126
- rp_ge.processing = true;
8184
+ if (ret[0] && !rp_ge[$t.p.id].processing) {
8185
+ rp_ge[$t.p.id].processing = true;
8127
8186
  $("#sData", "#" + frmtb + "_2").addClass('ui-state-active');
8128
8187
  oper = opers.oper;
8129
8188
  idname = opers.id;
@@ -8138,7 +8197,7 @@ var xmlJsonClass = {
8138
8197
  }
8139
8198
  }
8140
8199
  delete postdata[$t.p.id + "_id"];
8141
- postdata = $.extend(postdata, rp_ge.editData, onCS);
8200
+ postdata = $.extend(postdata, rp_ge[$t.p.id].editData, onCS);
8142
8201
  if ($t.p.treeGrid === true) {
8143
8202
  if (postdata[oper] == opers.addoper) {
8144
8203
  selr = $($t).jqGrid("getGridParam", 'selrow');
@@ -8161,22 +8220,22 @@ var xmlJsonClass = {
8161
8220
  }
8162
8221
 
8163
8222
  var ajaxOptions = $.extend({
8164
- url: rp_ge.url ? rp_ge.url : $($t).jqGrid('getGridParam', 'editurl'),
8165
- type: rp_ge.mtype,
8166
- data: $.isFunction(rp_ge.serializeEditData) ? rp_ge.serializeEditData(postdata) : postdata,
8223
+ url: rp_ge[$t.p.id].url ? rp_ge[$t.p.id].url : $($t).jqGrid('getGridParam', 'editurl'),
8224
+ type: rp_ge[$t.p.id].mtype,
8225
+ data: $.isFunction(rp_ge[$t.p.id].serializeEditData) ? rp_ge[$t.p.id].serializeEditData(postdata) : postdata,
8167
8226
  complete:function(data, Status) {
8168
8227
  if (Status != "success") {
8169
8228
  ret[0] = false;
8170
- if ($.isFunction(rp_ge.errorTextFormat)) {
8171
- ret[1] = rp_ge.errorTextFormat(data);
8229
+ if ($.isFunction(rp_ge[$t.p.id].errorTextFormat)) {
8230
+ ret[1] = rp_ge[$t.p.id].errorTextFormat(data);
8172
8231
  } else {
8173
8232
  ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
8174
8233
  }
8175
8234
  } else {
8176
8235
  // data is posted successful
8177
8236
  // execute aftersubmit with the returned data from server
8178
- if ($.isFunction(rp_ge.afterSubmit)) {
8179
- ret = rp_ge.afterSubmit(data, postdata);
8237
+ if ($.isFunction(rp_ge[$t.p.id].afterSubmit)) {
8238
+ ret = rp_ge[$t.p.id].afterSubmit(data, postdata);
8180
8239
  }
8181
8240
  }
8182
8241
  if (ret[0] === false) {
@@ -8198,7 +8257,7 @@ var xmlJsonClass = {
8198
8257
  postdata[n] = $.jgrid.htmlDecode(v);
8199
8258
  });
8200
8259
  }
8201
- rp_ge.reloadAfterSubmit = rp_ge.reloadAfterSubmit && $t.p.datatype != "local";
8260
+ //rp_ge[$t.p.id].reloadAfterSubmit = rp_ge[$t.p.id].reloadAfterSubmit && $t.p.datatype != "local";
8202
8261
  // the action is add
8203
8262
  if (postdata[oper] == opers.addoper) {
8204
8263
  //id processing
@@ -8207,8 +8266,8 @@ var xmlJsonClass = {
8207
8266
  ret[2] = $.jgrid.randId();
8208
8267
  }
8209
8268
  postdata[idname] = ret[2];
8210
- if (rp_ge.closeAfterAdd) {
8211
- if (rp_ge.reloadAfterSubmit) {
8269
+ if (rp_ge[$t.p.id].closeAfterAdd) {
8270
+ if (rp_ge[$t.p.id].reloadAfterSubmit) {
8212
8271
  $($t).trigger("reloadGrid");
8213
8272
  }
8214
8273
  else {
@@ -8219,9 +8278,9 @@ var xmlJsonClass = {
8219
8278
  $($t).jqGrid("setSelection", ret[2]);
8220
8279
  }
8221
8280
  }
8222
- $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal,onClose: rp_ge.onClose});
8223
- } else if (rp_ge.clearAfterAdd) {
8224
- if (rp_ge.reloadAfterSubmit) {
8281
+ $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
8282
+ } else if (rp_ge[$t.p.id].clearAfterAdd) {
8283
+ if (rp_ge[$t.p.id].reloadAfterSubmit) {
8225
8284
  $($t).trigger("reloadGrid");
8226
8285
  }
8227
8286
  else {
@@ -8233,7 +8292,7 @@ var xmlJsonClass = {
8233
8292
  }
8234
8293
  fillData("_empty", $t, frmgr);
8235
8294
  } else {
8236
- if (rp_ge.reloadAfterSubmit) {
8295
+ if (rp_ge[$t.p.id].reloadAfterSubmit) {
8237
8296
  $($t).trigger("reloadGrid");
8238
8297
  }
8239
8298
  else {
@@ -8246,9 +8305,9 @@ var xmlJsonClass = {
8246
8305
  }
8247
8306
  } else {
8248
8307
  // the action is update
8249
- if (rp_ge.reloadAfterSubmit) {
8308
+ if (rp_ge[$t.p.id].reloadAfterSubmit) {
8250
8309
  $($t).trigger("reloadGrid");
8251
- if (!rp_ge.closeAfterEdit) {
8310
+ if (!rp_ge[$t.p.id].closeAfterEdit) {
8252
8311
  setTimeout(function() {
8253
8312
  $($t).jqGrid("setSelection", postdata[idname]);
8254
8313
  }, 1000);
@@ -8260,47 +8319,47 @@ var xmlJsonClass = {
8260
8319
  $($t).jqGrid("setRowData", postdata[idname], postdata);
8261
8320
  }
8262
8321
  }
8263
- if (rp_ge.closeAfterEdit) {
8264
- $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal,onClose: rp_ge.onClose});
8322
+ if (rp_ge[$t.p.id].closeAfterEdit) {
8323
+ $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
8265
8324
  }
8266
8325
  }
8267
- if ($.isFunction(rp_ge.afterComplete)) {
8326
+ if ($.isFunction(rp_ge[$t.p.id].afterComplete)) {
8268
8327
  copydata = data;
8269
8328
  setTimeout(function() {
8270
- rp_ge.afterComplete(copydata, postdata, $("#" + frmgr));
8329
+ rp_ge[$t.p.id].afterComplete(copydata, postdata, $("#" + frmgr));
8271
8330
  copydata = null;
8272
8331
  }, 500);
8273
8332
  }
8274
- if (rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
8333
+ if (rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {
8275
8334
  $("#" + frmgr).data("disabled", false);
8276
- if (rp_ge._savedData[$t.p.id + "_id"] != "_empty") {
8277
- for (var key in rp_ge._savedData) {
8335
+ if (rp_ge[$t.p.id]._savedData[$t.p.id + "_id"] != "_empty") {
8336
+ for (var key in rp_ge[$t.p.id]._savedData) {
8278
8337
  if (postdata[key]) {
8279
- rp_ge._savedData[key] = postdata[key];
8338
+ rp_ge[$t.p.id]._savedData[key] = postdata[key];
8280
8339
  }
8281
8340
  }
8282
8341
  }
8283
8342
  }
8284
8343
  }
8285
- rp_ge.processing = false;
8344
+ rp_ge[$t.p.id].processing = false;
8286
8345
  $("#sData", "#" + frmtb + "_2").removeClass('ui-state-active');
8287
8346
  try {
8288
8347
  $(':input:visible', "#" + frmgr)[0].focus();
8289
8348
  } catch (e) {
8290
8349
  }
8291
8350
  }
8292
- }, $.jgrid.ajaxOptions, rp_ge.ajaxEditOptions);
8351
+ }, $.jgrid.ajaxOptions, rp_ge[$t.p.id].ajaxEditOptions);
8293
8352
 
8294
- if (!ajaxOptions.url && !rp_ge.useDataProxy) {
8353
+ if (!ajaxOptions.url && !rp_ge[$t.p.id].useDataProxy) {
8295
8354
  if ($.isFunction($t.p.dataProxy)) {
8296
- rp_ge.useDataProxy = true;
8355
+ rp_ge[$t.p.id].useDataProxy = true;
8297
8356
  } else {
8298
8357
  ret[0] = false;
8299
8358
  ret[1] += " " + $.jgrid.errors.nourl;
8300
8359
  }
8301
8360
  }
8302
8361
  if (ret[0]) {
8303
- if (rp_ge.useDataProxy) {
8362
+ if (rp_ge[$t.p.id].useDataProxy) {
8304
8363
  $t.p.dataProxy.call($t, ajaxOptions, "set_" + $t.p.id);
8305
8364
  }
8306
8365
  else {
@@ -8311,7 +8370,7 @@ var xmlJsonClass = {
8311
8370
  if (ret[0] === false) {
8312
8371
  $("#FormError>td", "#" + frmtb).html(ret[1]);
8313
8372
  $("#FormError", "#" + frmtb).show();
8314
- // return;
8373
+ // return;
8315
8374
  }
8316
8375
  }
8317
8376
 
@@ -8339,18 +8398,16 @@ var xmlJsonClass = {
8339
8398
  function checkUpdates() {
8340
8399
  var stat = true;
8341
8400
  $("#FormError", "#" + frmtb).hide();
8342
- if (rp_ge.checkOnUpdate) {
8401
+ if (rp_ge[$t.p.id].checkOnUpdate) {
8343
8402
  postdata = {};
8344
8403
  extpost = {};
8345
8404
  getFormData();
8346
8405
  newData = $.extend({}, postdata, extpost);
8347
- diff = compareData(newData, rp_ge._savedData);
8406
+ diff = compareData(newData, rp_ge[$t.p.id]._savedData);
8348
8407
  if (diff) {
8349
8408
  $("#" + frmgr).data("disabled", true);
8350
8409
  $(".confirm", "#" + IDs.themodal).show();
8351
8410
  stat = false;
8352
- } else {
8353
- setNulls();
8354
8411
  }
8355
8412
  }
8356
8413
  return stat;
@@ -8400,14 +8457,14 @@ var xmlJsonClass = {
8400
8457
  restoreInline();
8401
8458
  $(".ui-jqdialog-title", "#" + IDs.modalhead).html(p.caption);
8402
8459
  $("#FormError", "#" + frmtb).hide();
8403
- if (rp_ge.topinfo) {
8404
- $(".topinfo", "#" + frmtb + "_2").html(rp_ge.topinfo);
8460
+ if (rp_ge[$t.p.id].topinfo) {
8461
+ $(".topinfo", "#" + frmtb + "_2").html(rp_ge[$t.p.id].topinfo);
8405
8462
  $(".tinfo", "#" + frmtb + "_2").show();
8406
8463
  } else {
8407
8464
  $(".tinfo", "#" + frmtb + "_2").hide();
8408
8465
  }
8409
- if (rp_ge.bottominfo) {
8410
- $(".bottominfo", "#" + frmtb + "_2").html(rp_ge.bottominfo);
8466
+ if (rp_ge[$t.p.id].bottominfo) {
8467
+ $(".bottominfo", "#" + frmtb + "_2").html(rp_ge[$t.p.id].bottominfo);
8411
8468
  $(".binfo", "#" + frmtb + "_2").show();
8412
8469
  } else {
8413
8470
  $(".binfo", "#" + frmtb + "_2").hide();
@@ -8415,13 +8472,13 @@ var xmlJsonClass = {
8415
8472
  // filldata
8416
8473
  fillData(rowid, $t, frmgr);
8417
8474
  ///
8418
- if (rowid == "_empty" || !rp_ge.viewPagerButtons) {
8475
+ if (rowid == "_empty" || !rp_ge[$t.p.id].viewPagerButtons) {
8419
8476
  $("#pData, #nData", "#" + frmtb + "_2").hide();
8420
8477
  } else {
8421
8478
  $("#pData, #nData", "#" + frmtb + "_2").show();
8422
8479
  }
8423
- if (rp_ge.processing === true) {
8424
- rp_ge.processing = false;
8480
+ if (rp_ge[$t.p.id].processing === true) {
8481
+ rp_ge[$t.p.id].processing = false;
8425
8482
  $("#sData", "#" + frmtb + "_2").removeClass('ui-state-active');
8426
8483
  }
8427
8484
  if ($("#" + frmgr).data("disabled") === true) {
@@ -8431,14 +8488,14 @@ var xmlJsonClass = {
8431
8488
  if (onBeforeShow) {
8432
8489
  onBeforeShow($("#" + frmgr));
8433
8490
  }
8434
- $("#" + IDs.themodal).data("onClose", rp_ge.onClose);
8491
+ $("#" + IDs.themodal).data("onClose", rp_ge[$t.p.id].onClose);
8435
8492
  $.jgrid.viewModal("#" + IDs.themodal, {gbox:"#gbox_" + gID,jqm:p.jqModal, jqM: false, overlay: p.overlay, modal:p.modal});
8436
8493
  if (!closeovrl) {
8437
8494
  $(".jqmOverlay").click(function() {
8438
8495
  if (!checkUpdates()) {
8439
8496
  return false;
8440
8497
  }
8441
- $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal, onClose: rp_ge.onClose});
8498
+ $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
8442
8499
  return false;
8443
8500
  });
8444
8501
  }
@@ -8469,7 +8526,7 @@ var xmlJsonClass = {
8469
8526
  flr[0].rp = 0;
8470
8527
  $(tbl).append(flr);
8471
8528
  //topinfo
8472
- flr = $("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='" + (maxCols * 2) + "'>" + rp_ge.topinfo + "</td></tr>");
8529
+ flr = $("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='" + (maxCols * 2) + "'>" + rp_ge[$t.p.id].topinfo + "</td></tr>");
8473
8530
  flr[0].rp = 0;
8474
8531
  $(tbl).append(flr);
8475
8532
  // set the id.
@@ -8485,10 +8542,10 @@ var xmlJsonClass = {
8485
8542
  bS = "<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>" + p.bSubmit + "</a>",
8486
8543
  bC = "<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>" + p.bCancel + "</a>";
8487
8544
  var bt = "<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='" + frmtb + "_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>" + (rtlb ? bN + bP : bP + bN) + "</td><td class='EditButton'>" + bS + bC + "</td></tr>";
8488
- bt += "<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>" + rp_ge.bottominfo + "</td></tr>";
8545
+ bt += "<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>" + rp_ge[$t.p.id].bottominfo + "</td></tr>";
8489
8546
  bt += "</tbody></table>";
8490
8547
  if (maxRows > 0) {
8491
- var sd = [];
8548
+ var sd = [], div = {};
8492
8549
  $.each($(tbl)[0].rows, function(i, r) {
8493
8550
  sd[i] = r;
8494
8551
  });
@@ -8502,8 +8559,9 @@ var xmlJsonClass = {
8502
8559
  return 0;
8503
8560
  });
8504
8561
  $.each(sd, function(index, row) {
8505
- $('tbody', tbl).append(row);
8562
+ div.html += row;
8506
8563
  });
8564
+ $('tbody', tbl).append(div.html);
8507
8565
  }
8508
8566
  p.gbox = "#gbox_" + gID;
8509
8567
  var cle = false;
@@ -8517,10 +8575,10 @@ var xmlJsonClass = {
8517
8575
  $("#pData, #nData", "#" + frmtb + "_2").css("float", "right");
8518
8576
  $(".EditButton", "#" + frmtb + "_2").css("text-align", "left");
8519
8577
  }
8520
- if (rp_ge.topinfo) {
8578
+ if (rp_ge[$t.p.id].topinfo) {
8521
8579
  $(".tinfo", "#" + frmtb + "_2").show();
8522
8580
  }
8523
- if (rp_ge.bottominfo) {
8581
+ if (rp_ge[$t.p.id].bottominfo) {
8524
8582
  $(".binfo", "#" + frmtb + "_2").show();
8525
8583
  }
8526
8584
  tms = null;
@@ -8530,7 +8588,7 @@ var xmlJsonClass = {
8530
8588
  if ($("#" + frmgr).data("disabled") === true) {
8531
8589
  return false;
8532
8590
  }//??
8533
- if (rp_ge.savekey[0] === true && e.which == rp_ge.savekey[1]) { // save
8591
+ if (rp_ge[$t.p.id].savekey[0] === true && e.which == rp_ge[$t.p.id].savekey[1]) { // save
8534
8592
  if (wkey.tagName != "TEXTAREA") {
8535
8593
  $("#sData", "#" + frmtb + "_2").trigger("click");
8536
8594
  return false;
@@ -8541,19 +8599,19 @@ var xmlJsonClass = {
8541
8599
  return false;
8542
8600
  }
8543
8601
  if (cle) {
8544
- $.jgrid.hideModal(this, {gb:p.gbox,jqm:p.jqModal, onClose: rp_ge.onClose});
8602
+ $.jgrid.hideModal(this, {gb:p.gbox,jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
8545
8603
  }
8546
8604
  return false;
8547
8605
  }
8548
- if (rp_ge.navkeys[0] === true) {
8606
+ if (rp_ge[$t.p.id].navkeys[0] === true) {
8549
8607
  if ($("#id_g", "#" + frmtb).val() == "_empty") {
8550
8608
  return true;
8551
8609
  }
8552
- if (e.which == rp_ge.navkeys[1]) { //up
8610
+ if (e.which == rp_ge[$t.p.id].navkeys[1]) { //up
8553
8611
  $("#pData", "#" + frmtb + "_2").trigger("click");
8554
8612
  return false;
8555
8613
  }
8556
- if (e.which == rp_ge.navkeys[2]) { //down
8614
+ if (e.which == rp_ge[$t.p.id].navkeys[2]) { //down
8557
8615
  $("#nData", "#" + frmtb + "_2").trigger("click");
8558
8616
  return false;
8559
8617
  }
@@ -8563,12 +8621,12 @@ var xmlJsonClass = {
8563
8621
  $("a.ui-jqdialog-titlebar-close span", "#" + IDs.themodal).removeClass("jqmClose");
8564
8622
  $("a.ui-jqdialog-titlebar-close", "#" + IDs.themodal).unbind("click")
8565
8623
  .click(function() {
8566
- if (!checkUpdates()) {
8567
- return false;
8568
- }
8569
- $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal,onClose: rp_ge.onClose});
8570
- return false;
8571
- });
8624
+ if (!checkUpdates()) {
8625
+ return false;
8626
+ }
8627
+ $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
8628
+ return false;
8629
+ });
8572
8630
  }
8573
8631
  p.saveicon = $.extend([true,"left","ui-icon-disk"], p.saveicon);
8574
8632
  p.closeicon = $.extend([true,"left","ui-icon-close"], p.closeicon);
@@ -8581,7 +8639,7 @@ var xmlJsonClass = {
8581
8639
  $("#cData", "#" + frmtb + "_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
8582
8640
  .append("<span class='ui-icon " + p.closeicon[2] + "'></span>");
8583
8641
  }
8584
- if (rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
8642
+ if (rp_ge[$t.p.id].checkOnSubmit || rp_ge[$t.p.id].checkOnUpdate) {
8585
8643
  bS = "<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>" + p.bYes + "</a>";
8586
8644
  bN = "<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>" + p.bNo + "</a>";
8587
8645
  bC = "<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>" + p.bExit + "</a>";
@@ -8610,7 +8668,7 @@ var xmlJsonClass = {
8610
8668
  $("#cNew", "#" + IDs.themodal).click(function() {
8611
8669
  $(".confirm", "#" + IDs.themodal).hide();
8612
8670
  $("#" + frmgr).data("disabled", false);
8613
- $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal,onClose: rp_ge.onClose});
8671
+ $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
8614
8672
  return false;
8615
8673
  });
8616
8674
  }
@@ -8618,7 +8676,7 @@ var xmlJsonClass = {
8618
8676
  if (onInitializeForm) {
8619
8677
  onInitializeForm($("#" + frmgr));
8620
8678
  }
8621
- if (rowid == "_empty" || !rp_ge.viewPagerButtons) {
8679
+ if (rowid == "_empty" || !rp_ge[$t.p.id].viewPagerButtons) {
8622
8680
  $("#pData,#nData", "#" + frmtb + "_2").hide();
8623
8681
  } else {
8624
8682
  $("#pData,#nData", "#" + frmtb + "_2").show();
@@ -8626,14 +8684,14 @@ var xmlJsonClass = {
8626
8684
  if (onBeforeShow) {
8627
8685
  onBeforeShow($("#" + frmgr));
8628
8686
  }
8629
- $("#" + IDs.themodal).data("onClose", rp_ge.onClose);
8687
+ $("#" + IDs.themodal).data("onClose", rp_ge[$t.p.id].onClose);
8630
8688
  $.jgrid.viewModal("#" + IDs.themodal, {gbox:"#gbox_" + gID,jqm:p.jqModal, overlay: p.overlay,modal:p.modal});
8631
8689
  if (!closeovrl) {
8632
8690
  $(".jqmOverlay").click(function() {
8633
8691
  if (!checkUpdates()) {
8634
8692
  return false;
8635
8693
  }
8636
- $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal, onClose: rp_ge.onClose});
8694
+ $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
8637
8695
  return false;
8638
8696
  });
8639
8697
  }
@@ -8647,7 +8705,7 @@ var xmlJsonClass = {
8647
8705
  function() {
8648
8706
  $(this).removeClass('ui-state-hover');
8649
8707
  }
8650
- );
8708
+ );
8651
8709
  $("#sData", "#" + frmtb + "_2").click(function(e) {
8652
8710
  postdata = {};
8653
8711
  extpost = {};
@@ -8657,13 +8715,12 @@ var xmlJsonClass = {
8657
8715
  //ret[1] - msg if not succes
8658
8716
  //ret[2] - the id that will be set if reload after submit false
8659
8717
  getFormData();
8660
- setNulls();
8661
8718
  if (postdata[$t.p.id + "_id"] == "_empty") {
8662
8719
  postIt();
8663
8720
  }
8664
8721
  else if (p.checkOnSubmit === true) {
8665
8722
  newData = $.extend({}, postdata, extpost);
8666
- diff = compareData(newData, rp_ge._savedData);
8723
+ diff = compareData(newData, rp_ge[$t.p.id]._savedData);
8667
8724
  if (diff) {
8668
8725
  $("#" + frmgr).data("disabled", true);
8669
8726
  $(".confirm", "#" + IDs.themodal).show();
@@ -8679,7 +8736,7 @@ var xmlJsonClass = {
8679
8736
  if (!checkUpdates()) {
8680
8737
  return false;
8681
8738
  }
8682
- $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal,onClose: rp_ge.onClose});
8739
+ $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal,onClose: rp_ge[$t.p.id].onClose});
8683
8740
  return false;
8684
8741
  });
8685
8742
  $("#nData", "#" + frmtb + "_2").click(function(e) {
@@ -8735,7 +8792,7 @@ var xmlJsonClass = {
8735
8792
  height: 'auto',
8736
8793
  dataheight: 'auto',
8737
8794
  modal: false,
8738
- overlay: 10,
8795
+ overlay: 30,
8739
8796
  drag: true,
8740
8797
  resize: true,
8741
8798
  jqModal: true,
@@ -9021,7 +9078,7 @@ var xmlJsonClass = {
9021
9078
  function() {
9022
9079
  $(this).removeClass('ui-state-hover');
9023
9080
  }
9024
- );
9081
+ );
9025
9082
  focusaref();
9026
9083
  $("#cData", "#" + frmtb + "_2").click(function(e) {
9027
9084
  $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal, onClose: p.onClose});
@@ -9075,7 +9132,7 @@ var xmlJsonClass = {
9075
9132
  height: 'auto',
9076
9133
  dataheight : 'auto',
9077
9134
  modal: false,
9078
- overlay: 10,
9135
+ overlay: 30,
9079
9136
  drag: true,
9080
9137
  resize: true,
9081
9138
  url : '',
@@ -9098,7 +9155,7 @@ var xmlJsonClass = {
9098
9155
  serializeDelData : null,
9099
9156
  useDataProxy : false
9100
9157
  }, $.jgrid.del, p || {});
9101
- rp_ge = p;
9158
+ rp_ge[$(this)[0].p.id] = p;
9102
9159
  return this.each(function() {
9103
9160
  var $t = this;
9104
9161
  if (!$t.grid) {
@@ -9107,9 +9164,9 @@ var xmlJsonClass = {
9107
9164
  if (!rowids) {
9108
9165
  return;
9109
9166
  }
9110
- var onBeforeShow = $.isFunction(p.beforeShowForm),
9111
- onAfterShow = $.isFunction(p.afterShowForm),
9112
- onBeforeInit = $.isFunction(p.beforeInitData) ? p.beforeInitData : false,
9167
+ var onBeforeShow = $.isFunction(rp_ge[$t.p.id].beforeShowForm),
9168
+ onAfterShow = $.isFunction(rp_ge[$t.p.id].afterShowForm),
9169
+ onBeforeInit = $.isFunction(rp_ge[$t.p.id].beforeInitData) ? rp_ge[$t.p.id].beforeInitData : false,
9113
9170
  gID = $t.p.id, onCS = {},
9114
9171
  showFrm = true,
9115
9172
  dtbl = "DelTbl_" + gID,postd, idname, opers, oper,
@@ -9129,30 +9186,30 @@ var xmlJsonClass = {
9129
9186
  }
9130
9187
  $("#DelData>td", "#" + dtbl).text(rowids);
9131
9188
  $("#DelError", "#" + dtbl).hide();
9132
- if (rp_ge.processing === true) {
9133
- rp_ge.processing = false;
9189
+ if (rp_ge[$t.p.id].processing === true) {
9190
+ rp_ge[$t.p.id].processing = false;
9134
9191
  $("#dData", "#" + dtbl).removeClass('ui-state-active');
9135
9192
  }
9136
9193
  if (onBeforeShow) {
9137
- p.beforeShowForm($("#" + dtbl));
9194
+ rp_ge[$t.p.id].beforeShowForm($("#" + dtbl));
9138
9195
  }
9139
- $.jgrid.viewModal("#" + IDs.themodal, {gbox:"#gbox_" + gID,jqm:p.jqModal,jqM: false, overlay: p.overlay, modal:p.modal});
9196
+ $.jgrid.viewModal("#" + IDs.themodal, {gbox:"#gbox_" + gID,jqm:rp_ge[$t.p.id].jqModal,jqM: false, overlay: rp_ge[$t.p.id].overlay, modal:rp_ge[$t.p.id].modal});
9140
9197
  if (onAfterShow) {
9141
- p.afterShowForm($("#" + dtbl));
9198
+ rp_ge[$t.p.id].afterShowForm($("#" + dtbl));
9142
9199
  }
9143
9200
  } else {
9144
- var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight + "px";
9201
+ var dh = isNaN(rp_ge[$t.p.id].dataheight) ? rp_ge[$t.p.id].dataheight : rp_ge[$t.p.id].dataheight + "px";
9145
9202
  var tbl = "<div id='" + dtbl + "' class='formdata' style='width:100%;overflow:auto;position:relative;height:" + dh + ";'>";
9146
9203
  tbl += "<table class='DelTable'><tbody>";
9147
- // error data
9204
+ // error data
9148
9205
  tbl += "<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";
9149
9206
  tbl += "<tr id='DelData' style='display:none'><td >" + rowids + "</td></tr>";
9150
- tbl += "<tr><td class=\"delmsg\" style=\"white-space:pre;\">" + p.msg + "</td></tr><tr><td >&#160;</td></tr>";
9207
+ tbl += "<tr><td class=\"delmsg\" style=\"white-space:pre;\">" + rp_ge[$t.p.id].msg + "</td></tr><tr><td >&#160;</td></tr>";
9151
9208
  // buttons at footer
9152
9209
  tbl += "</tbody></table></div>";
9153
9210
  var bS = "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>" + p.bSubmit + "</a>",
9154
9211
  bC = "<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>" + p.bCancel + "</a>";
9155
- tbl += "<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='" + dtbl + "_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr></tr><tr><td class='DelButton EditButton'>" + bS + "&#160;" + bC + "</td></tr></tbody></table>";
9212
+ tbl += "<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='" + dtbl + "_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr><td class='DelButton EditButton'>" + bS + "&#160;" + bC + "</td></tr></tbody></table>";
9156
9213
  p.gbox = "#gbox_" + gID;
9157
9214
  $.jgrid.createModal(IDs, tbl, p, "#gview_" + $t.p.id, $("#gview_" + $t.p.id)[0]);
9158
9215
 
@@ -9173,9 +9230,9 @@ var xmlJsonClass = {
9173
9230
  function() {
9174
9231
  $(this).removeClass('ui-state-hover');
9175
9232
  }
9176
- );
9177
- p.delicon = $.extend([true,"left","ui-icon-scissors"], p.delicon);
9178
- p.cancelicon = $.extend([true,"left","ui-icon-cancel"], p.cancelicon);
9233
+ );
9234
+ p.delicon = $.extend([true,"left","ui-icon-scissors"], rp_ge[$t.p.id].delicon);
9235
+ p.cancelicon = $.extend([true,"left","ui-icon-cancel"], rp_ge[$t.p.id].cancelicon);
9179
9236
  if (p.delicon[0] === true) {
9180
9237
  $("#dData", "#" + dtbl + "_2").addClass(p.delicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
9181
9238
  .append("<span class='ui-icon " + p.delicon[2] + "'></span>");
@@ -9188,17 +9245,17 @@ var xmlJsonClass = {
9188
9245
  var ret = [true,""];
9189
9246
  onCS = {};
9190
9247
  var postdata = $("#DelData>td", "#" + dtbl).text(); //the pair is name=val1,val2,...
9191
- if ($.isFunction(p.onclickSubmit)) {
9192
- onCS = p.onclickSubmit(rp_ge, postdata) || {};
9248
+ if ($.isFunction(rp_ge[$t.p.id].onclickSubmit)) {
9249
+ onCS = rp_ge[$t.p.id].onclickSubmit(rp_ge[$t.p.id], postdata) || {};
9193
9250
  }
9194
- if ($.isFunction(p.beforeSubmit)) {
9195
- ret = p.beforeSubmit(postdata);
9251
+ if ($.isFunction(rp_ge[$t.p.id].beforeSubmit)) {
9252
+ ret = rp_ge[$t.p.id].beforeSubmit(postdata);
9196
9253
  }
9197
- if (ret[0] && !rp_ge.processing) {
9198
- rp_ge.processing = true;
9254
+ if (ret[0] && !rp_ge[$t.p.id].processing) {
9255
+ rp_ge[$t.p.id].processing = true;
9199
9256
  $(this).addClass('ui-state-active');
9200
9257
  opers = $t.p.prmNames;
9201
- postd = $.extend({}, rp_ge.delData, onCS);
9258
+ postd = $.extend({}, rp_ge[$t.p.id].delData, onCS);
9202
9259
  oper = opers.oper;
9203
9260
  postd[oper] = opers.deloper;
9204
9261
  idname = opers.id;
@@ -9209,29 +9266,29 @@ var xmlJsonClass = {
9209
9266
  }
9210
9267
 
9211
9268
  var ajaxOptions = $.extend({
9212
- url: rp_ge.url ? rp_ge.url : $($t).jqGrid('getGridParam', 'editurl'),
9213
- type: p.mtype,
9214
- data: $.isFunction(p.serializeDelData) ? p.serializeDelData(postd) : postd,
9269
+ url: rp_ge[$t.p.id].url ? rp_ge[$t.p.id].url : $($t).jqGrid('getGridParam', 'editurl'),
9270
+ type: rp_ge[$t.p.id].mtype,
9271
+ data: $.isFunction(rp_ge[$t.p.id].serializeDelData) ? rp_ge[$t.p.id].serializeDelData(postd) : postd,
9215
9272
  complete:function(data, Status) {
9216
9273
  if (Status != "success") {
9217
9274
  ret[0] = false;
9218
- if ($.isFunction(rp_ge.errorTextFormat)) {
9219
- ret[1] = rp_ge.errorTextFormat(data);
9275
+ if ($.isFunction(rp_ge[$t.p.id].errorTextFormat)) {
9276
+ ret[1] = rp_ge[$t.p.id].errorTextFormat(data);
9220
9277
  } else {
9221
9278
  ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
9222
9279
  }
9223
9280
  } else {
9224
9281
  // data is posted successful
9225
9282
  // execute aftersubmit with the returned data from server
9226
- if ($.isFunction(rp_ge.afterSubmit)) {
9227
- ret = rp_ge.afterSubmit(data, postd);
9283
+ if ($.isFunction(rp_ge[$t.p.id].afterSubmit)) {
9284
+ ret = rp_ge[$t.p.id].afterSubmit(data, postd);
9228
9285
  }
9229
9286
  }
9230
9287
  if (ret[0] === false) {
9231
9288
  $("#DelError>td", "#" + dtbl).html(ret[1]);
9232
9289
  $("#DelError", "#" + dtbl).show();
9233
9290
  } else {
9234
- if (rp_ge.reloadAfterSubmit && $t.p.datatype != "local") {
9291
+ if (rp_ge[$t.p.id].reloadAfterSubmit && $t.p.datatype != "local") {
9235
9292
  $($t).trigger("reloadGrid");
9236
9293
  } else {
9237
9294
  var toarr = [];
@@ -9249,31 +9306,31 @@ var xmlJsonClass = {
9249
9306
  $t.p.selrow = null;
9250
9307
  $t.p.selarrrow = [];
9251
9308
  }
9252
- if ($.isFunction(rp_ge.afterComplete)) {
9309
+ if ($.isFunction(rp_ge[$t.p.id].afterComplete)) {
9253
9310
  setTimeout(function() {
9254
- rp_ge.afterComplete(data, postdata);
9311
+ rp_ge[$t.p.id].afterComplete(data, postdata);
9255
9312
  }, 500);
9256
9313
  }
9257
9314
  }
9258
- rp_ge.processing = false;
9315
+ rp_ge[$t.p.id].processing = false;
9259
9316
  $("#dData", "#" + dtbl + "_2").removeClass('ui-state-active');
9260
9317
  if (ret[0]) {
9261
- $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal, onClose: rp_ge.onClose});
9318
+ $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal, onClose: rp_ge[$t.p.id].onClose});
9262
9319
  }
9263
9320
  }
9264
- }, $.jgrid.ajaxOptions, p.ajaxDelOptions);
9321
+ }, $.jgrid.ajaxOptions, rp_ge[$t.p.id].ajaxDelOptions);
9265
9322
 
9266
9323
 
9267
- if (!ajaxOptions.url && !rp_ge.useDataProxy) {
9324
+ if (!ajaxOptions.url && !rp_ge[$t.p.id].useDataProxy) {
9268
9325
  if ($.isFunction($t.p.dataProxy)) {
9269
- rp_ge.useDataProxy = true;
9326
+ rp_ge[$t.p.id].useDataProxy = true;
9270
9327
  } else {
9271
9328
  ret[0] = false;
9272
9329
  ret[1] += " " + $.jgrid.errors.nourl;
9273
9330
  }
9274
9331
  }
9275
9332
  if (ret[0]) {
9276
- if (rp_ge.useDataProxy) {
9333
+ if (rp_ge[$t.p.id].useDataProxy) {
9277
9334
  $t.p.dataProxy.call($t, ajaxOptions, "del_" + $t.p.id);
9278
9335
  }
9279
9336
  else {
@@ -9289,18 +9346,18 @@ var xmlJsonClass = {
9289
9346
  return false;
9290
9347
  });
9291
9348
  $("#eData", "#" + dtbl + "_2").click(function(e) {
9292
- $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:p.jqModal, onClose: rp_ge.onClose});
9349
+ $.jgrid.hideModal("#" + IDs.themodal, {gb:"#gbox_" + gID,jqm:rp_ge[$t.p.id].jqModal, onClose: rp_ge[$t.p.id].onClose});
9293
9350
  return false;
9294
9351
  });
9295
9352
  if (onBeforeShow) {
9296
- p.beforeShowForm($("#" + dtbl));
9353
+ rp_ge[$t.p.id].beforeShowForm($("#" + dtbl));
9297
9354
  }
9298
- $.jgrid.viewModal("#" + IDs.themodal, {gbox:"#gbox_" + gID,jqm:p.jqModal, overlay: p.overlay, modal:p.modal});
9355
+ $.jgrid.viewModal("#" + IDs.themodal, {gbox:"#gbox_" + gID,jqm:rp_ge[$t.p.id].jqModal, overlay: rp_ge[$t.p.id].overlay, modal:rp_ge[$t.p.id].modal});
9299
9356
  if (onAfterShow) {
9300
- p.afterShowForm($("#" + dtbl));
9357
+ rp_ge[$t.p.id].afterShowForm($("#" + dtbl));
9301
9358
  }
9302
9359
  }
9303
- if (p.closeOnEscape === true) {
9360
+ if (rp_ge[$t.p.id].closeOnEscape === true) {
9304
9361
  setTimeout(function() {
9305
9362
  $(".ui-jqdialog-titlebar-close", "#" + IDs.modalhead).focus();
9306
9363
  }, 0);
@@ -9326,29 +9383,38 @@ var xmlJsonClass = {
9326
9383
  closeOnEscape : true,
9327
9384
  beforeRefresh : null,
9328
9385
  afterRefresh : null,
9329
- cloneToTop : false
9386
+ cloneToTop : false,
9387
+ alertwidth : 200,
9388
+ alertheight : 'auto',
9389
+ alerttop: null,
9390
+ alertleft: null,
9391
+ alertzIndex : null
9330
9392
  }, $.jgrid.nav, o || {});
9331
9393
  return this.each(function() {
9332
9394
  if (this.nav) {
9333
9395
  return;
9334
9396
  }
9335
9397
  var alertIDs = {themodal:'alertmod',modalhead:'alerthd',modalcontent:'alertcnt'},
9336
- $t = this, vwidth, vheight, twd, tdw;
9398
+ $t = this, twd, tdw;
9337
9399
  if (!$t.grid || typeof elem != 'string') {
9338
9400
  return;
9339
9401
  }
9340
9402
  if ($("#" + alertIDs.themodal).html() === null) {
9341
- if (typeof window.innerWidth != 'undefined') {
9342
- vwidth = window.innerWidth;
9343
- vheight = window.innerHeight;
9344
- } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth !== 0) {
9345
- vwidth = document.documentElement.clientWidth;
9346
- vheight = document.documentElement.clientHeight;
9347
- } else {
9348
- vwidth = 1024;
9349
- vheight = 768;
9403
+ if (!o.alerttop && !o.alertleft) {
9404
+ if (typeof window.innerWidth != 'undefined') {
9405
+ o.alertleft = window.innerWidth;
9406
+ o.alerttop = window.innerHeight;
9407
+ } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth !== 0) {
9408
+ o.alertleft = document.documentElement.clientWidth;
9409
+ o.alerttop = document.documentElement.clientHeight;
9410
+ } else {
9411
+ o.alertleft = 1024;
9412
+ o.alerttop = 768;
9413
+ }
9414
+ o.alertleft = o.alertleft / 2 - parseInt(o.alertwidth, 10) / 2;
9415
+ o.alerttop = o.alerttop / 2 - 25;
9350
9416
  }
9351
- $.jgrid.createModal(alertIDs, "<div>" + o.alerttext + "</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>", {gbox:"#gbox_" + $t.p.id,jqModal:true,drag:true,resize:true,caption:o.alertcap,top:vheight / 2 - 25,left:vwidth / 2 - 100,width:200,height:'auto',closeOnEscape:o.closeOnEscape}, "", "", true);
9417
+ $.jgrid.createModal(alertIDs, "<div>" + o.alerttext + "</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>", {gbox:"#gbox_" + $t.p.id,jqModal:true,drag:true,resize:true,caption:o.alertcap,top:o.alerttop,left:o.alertleft,width:o.alertwidth,height: o.alertheight,closeOnEscape:o.closeOnEscape, zIndex: o.alertzIndex}, "", "", true);
9352
9418
  }
9353
9419
  var clone = 1;
9354
9420
  if (o.cloneToTop && $t.p.toppager) {
@@ -9399,7 +9465,7 @@ var xmlJsonClass = {
9399
9465
  function () {
9400
9466
  $(this).removeClass("ui-state-hover");
9401
9467
  }
9402
- );
9468
+ );
9403
9469
  tbd = null;
9404
9470
  }
9405
9471
  if (o.edit) {
@@ -9434,7 +9500,7 @@ var xmlJsonClass = {
9434
9500
  function () {
9435
9501
  $(this).removeClass("ui-state-hover");
9436
9502
  }
9437
- );
9503
+ );
9438
9504
  tbd = null;
9439
9505
  }
9440
9506
  if (o.view) {
@@ -9469,7 +9535,7 @@ var xmlJsonClass = {
9469
9535
  function () {
9470
9536
  $(this).removeClass("ui-state-hover");
9471
9537
  }
9472
- );
9538
+ );
9473
9539
  tbd = null;
9474
9540
  }
9475
9541
  if (o.del) {
@@ -9512,7 +9578,7 @@ var xmlJsonClass = {
9512
9578
  function () {
9513
9579
  $(this).removeClass("ui-state-hover");
9514
9580
  }
9515
- );
9581
+ );
9516
9582
  tbd = null;
9517
9583
  }
9518
9584
  if (o.add || o.edit || o.del || o.view) {
@@ -9540,7 +9606,7 @@ var xmlJsonClass = {
9540
9606
  function () {
9541
9607
  $(this).removeClass("ui-state-hover");
9542
9608
  }
9543
- );
9609
+ );
9544
9610
  if (pSearch.showOnLoad && pSearch.showOnLoad === true)
9545
9611
  $(tbd, navtbl).click();
9546
9612
  tbd = null;
@@ -9593,7 +9659,7 @@ var xmlJsonClass = {
9593
9659
  function () {
9594
9660
  $(this).removeClass("ui-state-hover");
9595
9661
  }
9596
- );
9662
+ );
9597
9663
  tbd = null;
9598
9664
  }
9599
9665
  tdw = $(".ui-jqgrid").css("font-size") || "11px";
@@ -9657,13 +9723,13 @@ var xmlJsonClass = {
9657
9723
  $(tbd, findnav)
9658
9724
  .attr("title", p.title || "")
9659
9725
  .click(function(e) {
9660
- if (!$(this).hasClass('ui-state-disabled')) {
9661
- if ($.isFunction(p.onClickButton)) {
9662
- p.onClickButton.call($t, e);
9663
- }
9664
- }
9665
- return false;
9666
- })
9726
+ if (!$(this).hasClass('ui-state-disabled')) {
9727
+ if ($.isFunction(p.onClickButton)) {
9728
+ p.onClickButton.call($t, e);
9729
+ }
9730
+ }
9731
+ return false;
9732
+ })
9667
9733
  .hover(
9668
9734
  function () {
9669
9735
  if (!$(this).hasClass('ui-state-disabled')) {
@@ -9673,7 +9739,7 @@ var xmlJsonClass = {
9673
9739
  function () {
9674
9740
  $(this).removeClass("ui-state-hover");
9675
9741
  }
9676
- );
9742
+ );
9677
9743
  }
9678
9744
  });
9679
9745
  },
@@ -9773,7 +9839,8 @@ var xmlJsonClass = {
9773
9839
  "aftersavefunc" : aftersavefunc || null,
9774
9840
  "errorfunc": errorfunc || null,
9775
9841
  "afterrestorefunc" : afterrestorefunc || null,
9776
- "restoreAfterErorr" : true
9842
+ "restoreAfterError" : true,
9843
+ "mtype" : "POST"
9777
9844
  },
9778
9845
  args = $.makeArray(arguments).slice(1), o;
9779
9846
 
@@ -9839,7 +9906,7 @@ var xmlJsonClass = {
9839
9906
  $(this).append(elc);
9840
9907
  }
9841
9908
  //Again IE
9842
- if (cm[i].edittype == "select" && cm[i].editoptions.multiple === true && $.browser.msie) {
9909
+ if (cm[i].edittype == "select" && typeof(cm[i].editoptions) !== "undefined" && cm[i].editoptions.multiple === true && typeof(cm[i].editoptions.dataUrl) === "undefined" && $.browser.msie) {
9843
9910
  $(elc).width($(elc).width());
9844
9911
  }
9845
9912
  cnt++;
@@ -9883,7 +9950,8 @@ var xmlJsonClass = {
9883
9950
  "aftersavefunc" : aftersavefunc || null,
9884
9951
  "errorfunc": errorfunc || null,
9885
9952
  "afterrestorefunc" : afterrestorefunc || null,
9886
- "restoreAfterErorr" : true
9953
+ "restoreAfterError" : true,
9954
+ "mtype" : "POST"
9887
9955
  },
9888
9956
  args = $.makeArray(arguments).slice(1), o;
9889
9957
 
@@ -9926,8 +9994,8 @@ var xmlJsonClass = {
9926
9994
  break;
9927
9995
  case 'select':
9928
9996
  if (!cm.editoptions.multiple) {
9929
- tmp[nm] = $("select>option:selected", this).val();
9930
- tmp2[nm] = $("select>option:selected", this).text();
9997
+ tmp[nm] = $("select option:selected", this).val();
9998
+ tmp2[nm] = $("select option:selected", this).text();
9931
9999
  } else {
9932
10000
  var sel = $("select", this), selectedText = [];
9933
10001
  tmp[nm] = $(sel).val();
@@ -9936,11 +10004,11 @@ var xmlJsonClass = {
9936
10004
  } else {
9937
10005
  tmp[nm] = "";
9938
10006
  }
9939
- $("select > option:selected", this).each(
10007
+ $("select option:selected", this).each(
9940
10008
  function(i, selected) {
9941
10009
  selectedText[i] = $(selected).text();
9942
10010
  }
9943
- );
10011
+ );
9944
10012
  tmp2[nm] = selectedText.join(",");
9945
10013
  }
9946
10014
  if (cm.formatter && cm.formatter == 'select') {
@@ -10028,6 +10096,7 @@ var xmlJsonClass = {
10028
10096
  o.aftersavefunc.call($t, rowid, resp);
10029
10097
  }
10030
10098
  success = true;
10099
+ $(ind).unbind("keydown");
10031
10100
  } else {
10032
10101
  $("#lui_" + $t.p.id).show();
10033
10102
  if ($t.p.restful) {
@@ -10075,6 +10144,7 @@ var xmlJsonClass = {
10075
10144
  o.aftersavefunc.call($t, rowid, res);
10076
10145
  }
10077
10146
  success = true;
10147
+ $(ind).unbind("keydown");
10078
10148
  } else {
10079
10149
  if ($.isFunction(o.errorfunc)) {
10080
10150
  o.errorfunc.call($t, rowid, res, stat);
@@ -10103,7 +10173,6 @@ var xmlJsonClass = {
10103
10173
  }
10104
10174
  }, $.jgrid.ajaxOptions, $t.p.ajaxRowOptions || {}));
10105
10175
  }
10106
- $(ind).unbind("keydown");
10107
10176
  }
10108
10177
  return success;
10109
10178
  },
@@ -10330,7 +10399,7 @@ var xmlJsonClass = {
10330
10399
  function(i, selected) {
10331
10400
  selectedText[i] = $(selected).text();
10332
10401
  }
10333
- );
10402
+ );
10334
10403
  v2 = selectedText.join(",");
10335
10404
  }
10336
10405
  if (cm.formatter) {
@@ -10378,7 +10447,7 @@ var xmlJsonClass = {
10378
10447
  break;
10379
10448
  }
10380
10449
  // The common approach is if nothing changed do not do anything
10381
- if (v2 != $t.p.savedRow[fr].v) {
10450
+ if (v2 !== $t.p.savedRow[fr].v) {
10382
10451
  if ($.isFunction($t.p.beforeSaveCell)) {
10383
10452
  var vv = $t.p.beforeSaveCell.call($t, $t.rows[iRow].id, nm, v, iRow, iCol);
10384
10453
  if (vv) {
@@ -10591,50 +10660,50 @@ var xmlJsonClass = {
10591
10660
  $("#" + $t.p.knv)
10592
10661
  .focus()
10593
10662
  .keydown(function (e) {
10594
- kdir = e.keyCode;
10595
- if ($t.p.direction == "rtl") {
10596
- if (kdir == 37) {
10597
- kdir = 39;
10598
- }
10599
- else if (kdir == 39) {
10600
- kdir = 37;
10601
- }
10602
- }
10603
- switch (kdir) {
10604
- case 38:
10605
- if ($t.p.iRow - 1 > 0) {
10606
- scrollGrid($t.p.iRow - 1, $t.p.iCol, 'vu');
10607
- $($t).jqGrid("editCell", $t.p.iRow - 1, $t.p.iCol, false);
10608
- }
10609
- break;
10610
- case 40 :
10611
- if ($t.p.iRow + 1 <= $t.rows.length - 1) {
10612
- scrollGrid($t.p.iRow + 1, $t.p.iCol, 'vd');
10613
- $($t).jqGrid("editCell", $t.p.iRow + 1, $t.p.iCol, false);
10614
- }
10615
- break;
10616
- case 37 :
10617
- if ($t.p.iCol - 1 >= 0) {
10618
- i = findNextVisible($t.p.iCol - 1, 'lft');
10619
- scrollGrid($t.p.iRow, i, 'h');
10620
- $($t).jqGrid("editCell", $t.p.iRow, i, false);
10621
- }
10622
- break;
10623
- case 39 :
10624
- if ($t.p.iCol + 1 <= $t.p.colModel.length - 1) {
10625
- i = findNextVisible($t.p.iCol + 1, 'rgt');
10626
- scrollGrid($t.p.iRow, i, 'h');
10627
- $($t).jqGrid("editCell", $t.p.iRow, i, false);
10628
- }
10629
- break;
10630
- case 13:
10631
- if (parseInt($t.p.iCol, 10) >= 0 && parseInt($t.p.iRow, 10) >= 0) {
10632
- $($t).jqGrid("editCell", $t.p.iRow, $t.p.iCol, true);
10633
- }
10634
- break;
10635
- }
10636
- return false;
10637
- });
10663
+ kdir = e.keyCode;
10664
+ if ($t.p.direction == "rtl") {
10665
+ if (kdir == 37) {
10666
+ kdir = 39;
10667
+ }
10668
+ else if (kdir == 39) {
10669
+ kdir = 37;
10670
+ }
10671
+ }
10672
+ switch (kdir) {
10673
+ case 38:
10674
+ if ($t.p.iRow - 1 > 0) {
10675
+ scrollGrid($t.p.iRow - 1, $t.p.iCol, 'vu');
10676
+ $($t).jqGrid("editCell", $t.p.iRow - 1, $t.p.iCol, false);
10677
+ }
10678
+ break;
10679
+ case 40 :
10680
+ if ($t.p.iRow + 1 <= $t.rows.length - 1) {
10681
+ scrollGrid($t.p.iRow + 1, $t.p.iCol, 'vd');
10682
+ $($t).jqGrid("editCell", $t.p.iRow + 1, $t.p.iCol, false);
10683
+ }
10684
+ break;
10685
+ case 37 :
10686
+ if ($t.p.iCol - 1 >= 0) {
10687
+ i = findNextVisible($t.p.iCol - 1, 'lft');
10688
+ scrollGrid($t.p.iRow, i, 'h');
10689
+ $($t).jqGrid("editCell", $t.p.iRow, i, false);
10690
+ }
10691
+ break;
10692
+ case 39 :
10693
+ if ($t.p.iCol + 1 <= $t.p.colModel.length - 1) {
10694
+ i = findNextVisible($t.p.iCol + 1, 'rgt');
10695
+ scrollGrid($t.p.iRow, i, 'h');
10696
+ $($t).jqGrid("editCell", $t.p.iRow, i, false);
10697
+ }
10698
+ break;
10699
+ case 13:
10700
+ if (parseInt($t.p.iCol, 10) >= 0 && parseInt($t.p.iRow, 10) >= 0) {
10701
+ $($t).jqGrid("editCell", $t.p.iRow, $t.p.iCol, true);
10702
+ }
10703
+ break;
10704
+ }
10705
+ return false;
10706
+ });
10638
10707
  function scrollGrid(iR, iC, tp) {
10639
10708
  if (tp.substr(0, 1) == 'v') {
10640
10709
  var ch = $($t.grid.bDiv)[0].clientHeight,
@@ -10778,7 +10847,7 @@ var xmlJsonClass = {
10778
10847
  });
10779
10848
  return "<td role=\"grid\" aria-describedby=\"" + sid + "_subgrid\" class=\"ui-sgcollapsed sgcollapsed\" " + prp + "><a href='javascript:void(0);'><span class='ui-icon " + ic + "'></span></a></td>";
10780
10849
  },
10781
- addSubGrid : function(pos) {
10850
+ addSubGrid : function(pos, sind) {
10782
10851
  return this.each(function() {
10783
10852
  var ts = this;
10784
10853
  if (!ts.grid) {
@@ -10924,10 +10993,15 @@ var xmlJsonClass = {
10924
10993
  nhc++;
10925
10994
  }
10926
10995
  });
10927
- $(ts.rows).each(function(i) {
10928
- var tr = this;
10929
- if ($(tr).hasClass('jqgrow')) {
10930
- $(this.cells[pos]).bind('click', function(e) {
10996
+ var len = ts.rows.length, i = 1;
10997
+ if (sind !== undefined && sind > 0) {
10998
+ i = sind;
10999
+ len = sind + 1;
11000
+ }
11001
+ while (i < len) {
11002
+ if ($(ts.rows[i]).hasClass('jqgrow')) {
11003
+ $(ts.rows[i].cells[pos]).bind('click', function(e) {
11004
+ var tr = $(this).parent("tr")[0];
10931
11005
  r = tr.nextSibling;
10932
11006
  if ($(this).hasClass("sgcollapsed")) {
10933
11007
  pID = ts.p.id;
@@ -10972,13 +11046,12 @@ var xmlJsonClass = {
10972
11046
  }
10973
11047
  return false;
10974
11048
  });
10975
- if (ts.p.subGridOptions.expandOnLoad === true) {
10976
- setTimeout(function() {
10977
- $(tr.cells[pos]).trigger('click');
10978
- }, i * ts.p.subGridOptions.delayOnLoad);
10979
- }
10980
11049
  }
10981
- });
11050
+ if (ts.p.subGridOptions.expandOnLoad === true) {
11051
+ $(ts.rows[i].cells[pos]).trigger('click');
11052
+ }
11053
+ i++;
11054
+ }
10982
11055
  ts.subGridXml = function(xml, sid) {
10983
11056
  subGridXml(xml, sid);
10984
11057
  };
@@ -11116,13 +11189,13 @@ var xmlJsonClass = {
11116
11189
  lf = "";
11117
11190
  }
11118
11191
  ldat[expanded] = ((ldat[expanded] == "true" || ldat[expanded] === true) ? true : false) && ldat[loaded];
11119
- if (ldat[expanded] === true) {
11120
- twrap += $t.p.treeIcons.minus + " tree-minus treeclick'";
11192
+ if (ldat[expanded] === false) {
11193
+ twrap += ((ldat[isLeaf] === true) ? "'" : $t.p.treeIcons.plus + " tree-plus treeclick'");
11121
11194
  } else {
11122
- twrap += $t.p.treeIcons.plus + " tree-plus treeclick'";
11195
+ twrap += ((ldat[isLeaf] === true) ? "'" : $t.p.treeIcons.minus + " tree-minus treeclick'");
11123
11196
  }
11124
11197
 
11125
- twrap += "</div></div>";
11198
+ twrap += "></div></div>";
11126
11199
  $($t.rows[i].cells[expCol]).wrapInner("<span class='cell-wrapper" + lf + "'></span>").prepend(twrap);
11127
11200
 
11128
11201
  if (curLevel !== parseInt($t.p.tree_root_level, 10)) {
@@ -11135,40 +11208,40 @@ var xmlJsonClass = {
11135
11208
  $($t.rows[i].cells[expCol])
11136
11209
  .find("div.treeclick")
11137
11210
  .bind("click", function(e) {
11138
- var target = e.target || e.srcElement,
11139
- ind2 = $(target, $t.rows).closest("tr.jqgrow")[0].id,
11140
- pos = $t.p._index[ind2];
11141
- if (!$t.p.data[pos][isLeaf]) {
11142
- if ($t.p.data[pos][expanded]) {
11143
- $($t).jqGrid("collapseRow", $t.p.data[pos]);
11144
- $($t).jqGrid("collapseNode", $t.p.data[pos]);
11145
- } else {
11146
- $($t).jqGrid("expandRow", $t.p.data[pos]);
11147
- $($t).jqGrid("expandNode", $t.p.data[pos]);
11148
- }
11149
- }
11150
- return false;
11151
- });
11211
+ var target = e.target || e.srcElement,
11212
+ ind2 = $(target, $t.rows).closest("tr.jqgrow")[0].id,
11213
+ pos = $t.p._index[ind2];
11214
+ if (!$t.p.data[pos][isLeaf]) {
11215
+ if ($t.p.data[pos][expanded]) {
11216
+ $($t).jqGrid("collapseRow", $t.p.data[pos]);
11217
+ $($t).jqGrid("collapseNode", $t.p.data[pos]);
11218
+ } else {
11219
+ $($t).jqGrid("expandRow", $t.p.data[pos]);
11220
+ $($t).jqGrid("expandNode", $t.p.data[pos]);
11221
+ }
11222
+ }
11223
+ return false;
11224
+ });
11152
11225
  if ($t.p.ExpandColClick === true) {
11153
11226
  $($t.rows[i].cells[expCol])
11154
11227
  .find("span.cell-wrapper")
11155
11228
  .css("cursor", "pointer")
11156
11229
  .bind("click", function(e) {
11157
- var target = e.target || e.srcElement,
11158
- ind2 = $(target, $t.rows).closest("tr.jqgrow")[0].id,
11159
- pos = $t.p._index[ind2];
11160
- if (!$t.p.data[pos][isLeaf]) {
11161
- if ($t.p.data[pos][expanded]) {
11162
- $($t).jqGrid("collapseRow", $t.p.data[pos]);
11163
- $($t).jqGrid("collapseNode", $t.p.data[pos]);
11164
- } else {
11165
- $($t).jqGrid("expandRow", $t.p.data[pos]);
11166
- $($t).jqGrid("expandNode", $t.p.data[pos]);
11167
- }
11168
- }
11169
- $($t).jqGrid("setSelection", ind2);
11170
- return false;
11171
- });
11230
+ var target = e.target || e.srcElement,
11231
+ ind2 = $(target, $t.rows).closest("tr.jqgrow")[0].id,
11232
+ pos = $t.p._index[ind2];
11233
+ if (!$t.p.data[pos][isLeaf]) {
11234
+ if ($t.p.data[pos][expanded]) {
11235
+ $($t).jqGrid("collapseRow", $t.p.data[pos]);
11236
+ $($t).jqGrid("collapseNode", $t.p.data[pos]);
11237
+ } else {
11238
+ $($t).jqGrid("expandRow", $t.p.data[pos]);
11239
+ $($t).jqGrid("expandNode", $t.p.data[pos]);
11240
+ }
11241
+ }
11242
+ $($t).jqGrid("setSelection", ind2);
11243
+ return false;
11244
+ });
11172
11245
  }
11173
11246
  i++;
11174
11247
  }
@@ -11189,6 +11262,9 @@ var xmlJsonClass = {
11189
11262
  $t.p.pgbuttons = false;
11190
11263
  $t.p.pginput = false;
11191
11264
  $t.p.gridview = true;
11265
+ if ($t.p.rowTotal === null) {
11266
+ $t.p.rowNum = 10000;
11267
+ }
11192
11268
  $t.p.multiselect = false;
11193
11269
  $t.p.rowList = [];
11194
11270
  $t.p.expColInd = 0;
@@ -11841,7 +11917,7 @@ var xmlJsonClass = {
11841
11917
  grp.summaryval[0][itm] = $.extend(true, [], grp.summary[0]);
11842
11918
  }
11843
11919
  if (grp.groupSummary[0]) {
11844
- $.each(grp.summaryval[0][itm], function(i, n) {
11920
+ $.each(grp.summaryval[0][itm], function() {
11845
11921
  if ($.isFunction(this.st)) {
11846
11922
  this.v = this.st.call($t, this.v, this.nm, record);
11847
11923
  } else {
@@ -11862,7 +11938,7 @@ var xmlJsonClass = {
11862
11938
  minus = grp.minusicon,
11863
11939
  plus = grp.plusicon,
11864
11940
  tar = $("#" + hid),
11865
- r = tar[0].nextSibling,
11941
+ r = tar.length ? tar[0].nextSibling : null,
11866
11942
  tarspan = $("#" + hid + " span." + "tree-wrap-" + $t.p.direction),
11867
11943
  collapsed = false;
11868
11944
  if (tarspan.hasClass(minus)) {
@@ -11900,7 +11976,6 @@ var xmlJsonClass = {
11900
11976
  }
11901
11977
  }
11902
11978
  tarspan.removeClass(plus).addClass(minus);
11903
- collapsed = false;
11904
11979
  }
11905
11980
  if ($.isFunction($t.p.onClickGroup)) {
11906
11981
  $t.p.onClickGroup.call($t, hid, collapsed);
@@ -11913,7 +11988,7 @@ var xmlJsonClass = {
11913
11988
  return this.each(function() {
11914
11989
  var $t = this,
11915
11990
  grp = $t.p.groupingView,
11916
- str = "", icon = "", hid, pmrtl = "", gv, cp, ii;
11991
+ str = "", icon = "", hid, pmrtl = grp.groupCollapse ? grp.plusicon : grp.minusicon, gv, cp, ii;
11917
11992
  //only one level for now
11918
11993
  if (!grp.groupDataSorted) {
11919
11994
  // ???? TO BE IMPROVED
@@ -11924,12 +11999,6 @@ var xmlJsonClass = {
11924
11999
  grp.sortnames[0].reverse();
11925
12000
  }
11926
12001
  }
11927
- if (grp.groupCollapse) {
11928
- pmrtl = grp.plusicon;
11929
- }
11930
- else {
11931
- pmrtl = grp.minusicon;
11932
- }
11933
12002
  pmrtl += " tree-wrap-" + $t.p.direction;
11934
12003
  ii = 0;
11935
12004
  while (ii < colspans) {
@@ -11992,7 +12061,7 @@ var xmlJsonClass = {
11992
12061
  str = null;
11993
12062
  });
11994
12063
  },
11995
- groupingGroupBy : function (name, options, current) {
12064
+ groupingGroupBy : function (name, options) {
11996
12065
  return this.each(function() {
11997
12066
  var $t = this;
11998
12067
  if (typeof(name) == "string") {
@@ -12000,14 +12069,20 @@ var xmlJsonClass = {
12000
12069
  }
12001
12070
  var grp = $t.p.groupingView;
12002
12071
  $t.p.grouping = true;
12072
+
12073
+ //Set default, in case visibilityOnNextGrouping is undefined
12074
+ if (typeof grp.visibiltyOnNextGrouping == "undefined") {
12075
+ grp.visibiltyOnNextGrouping = [];
12076
+ }
12077
+ var i;
12003
12078
  // show previous hidden groups if they are hidden and weren't removed yet
12004
- for (var i = 0; i < grp.groupField.length; i++) {
12079
+ for (i = 0; i < grp.groupField.length; i++) {
12005
12080
  if (!grp.groupColumnShow[i] && grp.visibiltyOnNextGrouping[i]) {
12006
12081
  $($t).jqGrid('showCol', grp.groupField[i]);
12007
12082
  }
12008
12083
  }
12009
12084
  // set visibility status of current group columns on next grouping
12010
- for (var i = 0; i < name.length; i++) {
12085
+ for (i = 0; i < name.length; i++) {
12011
12086
  grp.visibiltyOnNextGrouping[i] = $("#" + $t.p.id + "_" + name[i]).is(":visible");
12012
12087
  }
12013
12088
  $t.p.groupingView = $.extend($t.p.groupingView, options || {});
@@ -12488,7 +12563,7 @@ var xmlJsonClass = {
12488
12563
 
12489
12564
  var perm = [];
12490
12565
  //fixedCols.slice(0);
12491
- $('option[selected]', select).each(function() {
12566
+ $('option:selected', select).each(function() {
12492
12567
  perm.push(parseInt(this.value, 10));
12493
12568
  });
12494
12569
  $.each(perm, function() {
@@ -12590,10 +12665,10 @@ var xmlJsonClass = {
12590
12665
  }
12591
12666
  if ($.fn.sortable) {
12592
12667
  opts = $.extend({
12593
- "cursor":"move",
12594
- "axis" : "y",
12595
- "items": ".jqgrow"
12596
- },
12668
+ "cursor":"move",
12669
+ "axis" : "y",
12670
+ "items": ".jqgrow"
12671
+ },
12597
12672
  opts || {});
12598
12673
  if (opts.start && $.isFunction(opts.start)) {
12599
12674
  opts._start_ = opts.start;
@@ -12627,7 +12702,7 @@ var xmlJsonClass = {
12627
12702
  $(ui.item).css("border-width", "");
12628
12703
  if ($t.p.rownumbers === true) {
12629
12704
  $("td.jqgrid-rownum", $t.rows).each(function(i) {
12630
- $(this).html(i + 1);
12705
+ $(this).html(i + 1 + (parseInt($t.p.page, 10) - 1) * parseInt($t.p.rowNum, 10));
12631
12706
  });
12632
12707
  }
12633
12708
  if (opts._update_) {
@@ -12695,7 +12770,7 @@ var xmlJsonClass = {
12695
12770
  }
12696
12771
  },
12697
12772
  stop :function(ev, ui) {
12698
- if (ui.helper.dropped) {
12773
+ if (ui.helper.dropped && !opts.dragcopy) {
12699
12774
  var ids = $(ui.helper).attr("id");
12700
12775
  $($t).jqGrid('delRowData', ids);
12701
12776
  }
@@ -12785,6 +12860,7 @@ var xmlJsonClass = {
12785
12860
  "appendTo" : "#jqgrid_dnd",
12786
12861
  "zIndex": 5000
12787
12862
  },
12863
+ "dragcopy": false,
12788
12864
  "dropbyname" : false,
12789
12865
  "droppos" : "first",
12790
12866
  "autoid" : true,
@@ -12867,8 +12943,8 @@ function tableToGrid(selector, options) {
12867
12943
  var w = jQuery(this).width();
12868
12944
 
12869
12945
  // Text whether we have single or multi select
12870
- var inputCheckbox = jQuery('input[type=checkbox]:first', jQuery(this));
12871
- var inputRadio = jQuery('input[type=radio]:first', jQuery(this));
12946
+ var inputCheckbox = jQuery('tr td:first-child input[type=checkbox]:first', jQuery(this));
12947
+ var inputRadio = jQuery('tr td:first-child input[type=radio]:first', jQuery(this));
12872
12948
  var selectMultiple = inputCheckbox.length > 0;
12873
12949
  var selectSingle = !selectMultiple && inputRadio.length > 0;
12874
12950
  var selectable = selectMultiple || selectSingle;
@@ -13204,7 +13280,7 @@ function tableToGrid(selector, options) {
13204
13280
  function() {
13205
13281
  $(this).removeClass('ui-state-hover');
13206
13282
  }
13207
- );
13283
+ );
13208
13284
  if (onBeforeShow) {
13209
13285
  p.beforeShowForm($("#" + dtbl));
13210
13286
  }
@@ -13598,12 +13674,12 @@ jQuery.tableDnD = {
13598
13674
  }
13599
13675
 
13600
13676
  jQuery.fn.extend(
13601
- {
13602
- tableDnD : jQuery.tableDnD.build,
13603
- tableDnDUpdate : jQuery.tableDnD.updateTables,
13604
- tableDnDSerialize: jQuery.tableDnD.serializeTables
13605
- }
13606
- );
13677
+ {
13678
+ tableDnD : jQuery.tableDnD.build,
13679
+ tableDnDUpdate : jQuery.tableDnD.updateTables,
13680
+ tableDnDSerialize: jQuery.tableDnD.serializeTables
13681
+ }
13682
+ );
13607
13683
 
13608
13684
  /*
13609
13685
  * jQuery UI Multiselect
@@ -13870,18 +13946,18 @@ jQuery.fn.extend(
13870
13946
  })
13871
13947
  // make draggable
13872
13948
  .each(function() {
13873
- $(this).parent().draggable({
13874
- connectToSortable: 'ul.selected',
13875
- helper: function() {
13876
- var selectedItem = that._cloneWithData($(this)).width($(this).width() - 50);
13877
- selectedItem.width($(this).width());
13878
- return selectedItem;
13879
- },
13880
- appendTo: '.ui-multiselect',
13881
- containment: '.ui-multiselect',
13882
- revert: 'invalid'
13883
- });
13884
- });
13949
+ $(this).parent().draggable({
13950
+ connectToSortable: 'ul.selected',
13951
+ helper: function() {
13952
+ var selectedItem = that._cloneWithData($(this)).width($(this).width() - 50);
13953
+ selectedItem.width($(this).width());
13954
+ return selectedItem;
13955
+ },
13956
+ appendTo: '.ui-multiselect',
13957
+ containment: '.ui-multiselect',
13958
+ revert: 'invalid'
13959
+ });
13960
+ });
13885
13961
  },
13886
13962
  _registerRemoveEvents: function(elements) {
13887
13963
  var that = this;
@@ -13899,15 +13975,15 @@ jQuery.fn.extend(
13899
13975
  $(this).addClass('ui-state-active');
13900
13976
  })
13901
13977
  .blur(function() {
13902
- $(this).removeClass('ui-state-active');
13903
- })
13978
+ $(this).removeClass('ui-state-active');
13979
+ })
13904
13980
  .keypress(function(e) {
13905
- if (e.keyCode == 13)
13906
- return false;
13907
- })
13981
+ if (e.keyCode == 13)
13982
+ return false;
13983
+ })
13908
13984
  .keyup(function() {
13909
- that._filter.apply(this, [that.availableList]);
13910
- });
13985
+ that._filter.apply(this, [that.availableList]);
13986
+ });
13911
13987
  }
13912
13988
  });
13913
13989