sidecompgrid.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. //左侧组件配置数据
  2. z.autodeploy.addSideComp({
  3. id:"sidecompgrid",
  4. sidecomp:{
  5. img:"https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2867068672,3134492367&fm=26&gp=0.jpg",
  6. text:"grid列表"
  7. },
  8. temp:function(compconfig){
  9. return '<div></div>';
  10. },
  11. render:function(el,compconfig){
  12. var options=compconfig.options,
  13. datasource=compconfig.datasource;
  14. z.ui.jqgrid(el).init({
  15. striped:options.striped&&options.striped.value,
  16. pagination:options.pagination&&options.pagination.value,
  17. height:options.height&&options.height.value,
  18. width:options.width&&options.width.value,
  19. rowNum :options.rowNum&&options.rowNum.value,
  20. rowList :options.rowList&&options.rowList.value,
  21. sortname :options.sortname&&options.sortname.value,
  22. sortorder :options.sortorder&&options.sortorder.value,
  23. viewrecords :options.viewrecords&&options.viewrecords.value,
  24. reloadfirstpage :options.reloadfirstpage&&options.reloadfirstpage.value,
  25. multiboxonly:options.multiboxonly&&options.multiboxonly.value,
  26. selectwidthcheck:options.selectwidthcheck&&options.selectwidthcheck.value,
  27. shrinkToFit :options.shrinkToFit&&options.shrinkToFit.value,
  28. multiselect :options.multiselect&&options.multiselect.value,
  29. headercount:options.heade&&options.headercount,
  30. mtype:'get',//向后台请求数据的ajax的类型,可选post,get,默认post
  31. url : datasource.url.value,//组件创建完成之后请求数据的url
  32. colModel : [
  33. {name: 'id',label:'id',width : 30,fixed:true},
  34. {name: 'invdate',label:'表头1',width : 50,fixed:true},
  35. {name: 'name',label:'表头2',width : 150,fixed:true},
  36. {name: 'amount',label:'表头3',width : 300,align : "right",minwidth:50},
  37. {name: 'tax',label:'表头4',width : 200,align : "right",minwidth:50},
  38. {name: 'total',label:'表头5',width : 300,align : "right",minwidth:50}
  39. ]
  40. });
  41. },
  42. options:{
  43. "multiselect":{
  44. type:'select',
  45. text:"有复选框",
  46. items:[
  47. {
  48. value:false,
  49. text:"否"
  50. },
  51. {
  52. value:true,
  53. text:"是"
  54. }
  55. ],
  56. value:false
  57. },
  58. "multiboxonly":{
  59. type:'select',
  60. text:"点击行单选",
  61. items:[
  62. {
  63. value:false,
  64. text:"否"
  65. },
  66. {
  67. value:true,
  68. text:"是"
  69. }
  70. ],
  71. value:true
  72. },
  73. "selectwidthcheck":{
  74. type:'select',
  75. text:"select关联checkbox",
  76. items:[
  77. {
  78. value:false,
  79. text:"否"
  80. },
  81. {
  82. value:true,
  83. text:"是"
  84. }
  85. ],
  86. value:true
  87. },
  88. "striped":{
  89. type:'select',
  90. text:"隔行变色",
  91. items:[
  92. {
  93. value:false,
  94. text:"否"
  95. },
  96. {
  97. value:true,
  98. text:"是"
  99. }
  100. ],
  101. value:true
  102. },
  103. "pagination":{
  104. type:'select',
  105. text:"是否分页",
  106. items:[
  107. {
  108. value:false,
  109. text:"否"
  110. },
  111. {
  112. value:true,
  113. text:"是"
  114. }
  115. ],
  116. value:true
  117. },
  118. "viewrecords":{
  119. type:'select',
  120. text:"显示总条数",
  121. items:[
  122. {
  123. value:false,
  124. text:"否"
  125. },
  126. {
  127. value:true,
  128. text:"是"
  129. }
  130. ],
  131. value:true
  132. },
  133. "reloadfirstpage":{
  134. type:'select',
  135. text:"刷新回到第一页",
  136. items:[
  137. {
  138. value:false,
  139. text:"否"
  140. },
  141. {
  142. value:true,
  143. text:"是"
  144. }
  145. ],
  146. value:true
  147. },
  148. "rowNum":{
  149. type:'select',
  150. text:"一页显示条数",
  151. items:[
  152. {
  153. value:"10",
  154. text:"10"
  155. },
  156. {
  157. value:"20",
  158. text:"20"
  159. },
  160. {
  161. value:"50",
  162. text:"50"
  163. },
  164. {
  165. value:"100",
  166. text:"100"
  167. }
  168. ],
  169. value:"10"
  170. },
  171. "width":{
  172. type:'input',
  173. text:"宽度",
  174. value:"",
  175. placeholder:"请输入"
  176. },
  177. "height":{
  178. type:'input',
  179. text:"高度",
  180. value:"",
  181. placeholder:"请输入"
  182. },
  183. },
  184. methods:{},
  185. datasource:{
  186. url:{
  187. type:'input',
  188. text:"地址",
  189. value:"compdata/griddata.json"
  190. }
  191. }
  192. })