jQuery MiniUI

 找回密码
 立即注册
查看: 1222|回复: 2
打印 上一主题 下一主题

关于grid的分组功能 [复制链接]

Rank: 2

跳转到指定楼层
楼主
发表于 2017-10-9 14:27:17 |只看该作者 |倒序浏览

请问怎么样让这个CodeName变成他们的分组依据 出库类型、入库类型呢
代码用的是:grid.groupBy('CodeName');
下面是数据源:
  1. [{
  2.     "OptionId": "4863158162181395557",
  3.     "CodeId": "",
  4.     "OptionVal": "销售出库",
  5.     "OptionCode": "2",
  6.     "IsReadOnly": false,
  7.     "StartValue": null,
  8.     "State": 1,
  9.     "CreateOn": "2017-06-23T13:34:25.637+08:00",
  10.     "CreaterId": "5139679221224071527",
  11.     "UpdateOn": null,
  12.     "UpdaterId": null,
  13.     "OrderNum": 0,
  14.     "i": 1,
  15.     "CodeName": "出库类型",
  16.     "UserRange": null
  17. },
  18. {
  19.     "OptionId": "5026641551143812663",
  20.     "CodeId": "",
  21.     "OptionVal": "调拨出库",
  22.     "OptionCode": "2",
  23.     "IsReadOnly": false,
  24.     "StartValue": null,
  25.     "State": 1,
  26.     "CreateOn": "2017-06-23T13:34:33.14+08:00",
  27.     "CreaterId": "5139679221224071527",
  28.     "UpdateOn": null,
  29.     "UpdaterId": null,
  30.     "OrderNum": 0,
  31.     "i": 2,
  32.     "CodeName": "出库类型",
  33.     "UserRange": null
  34. },
  35. {
  36.     "OptionId": "5761881572739818371",
  37.     "CodeId": "",
  38.     "OptionVal": "退货出库",
  39.     "OptionCode": "2",
  40.     "IsReadOnly": false,
  41.     "StartValue": null,
  42.     "State": 1,
  43.     "CreateOn": "2017-06-23T13:34:47.883+08:00",
  44.     "CreaterId": "5139679221224071527",
  45.     "UpdateOn": null,
  46.     "UpdaterId": null,
  47.     "OrderNum": 0,
  48.     "i": 3,
  49.     "CodeName": "出库类型",
  50.     "UserRange": null
  51. },
  52. {
  53.     "OptionId": "4755952183301968958",
  54.     "CodeId": "",
  55.     "OptionVal": "采购退货",
  56.     "OptionCode": "2",
  57.     "IsReadOnly": false,
  58.     "StartValue": null,
  59.     "State": 1,
  60.     "CreateOn": "2017-06-23T13:35:01.59+08:00",
  61.     "CreaterId": "5139679221224071527",
  62.     "UpdateOn": null,
  63.     "UpdaterId": null,
  64.     "OrderNum": 0,
  65.     "i": 4,
  66.     "CodeName": "出库类型",
  67.     "UserRange": null
  68. },
  69. {
  70.     "OptionId": "5155705782829541270",
  71.     "CodeId": "",
  72.     "OptionVal": "维修出库",
  73.     "OptionCode": "2",
  74.     "IsReadOnly": false,
  75.     "StartValue": null,
  76.     "State": 1,
  77.     "CreateOn": "2017-06-23T13:35:21.85+08:00",
  78.     "CreaterId": "5139679221224071527",
  79.     "UpdateOn": null,
  80.     "UpdaterId": null,
  81.     "OrderNum": 0,
  82.     "i": 5,
  83.     "CodeName": "出库类型",
  84.     "UserRange": null
  85. },
  86. {
  87.     "OptionId": "5493526084724560349",
  88.     "CodeId": "",
  89.     "OptionVal": "采购入库",
  90.     "OptionCode": "2",
  91.     "IsReadOnly": false,
  92.     "StartValue": null,
  93.     "State": 1,
  94.     "CreateOn": "2017-06-26T18:10:26.69+08:00",
  95.     "CreaterId": "100001",
  96.     "UpdateOn": null,
  97.     "UpdaterId": null,
  98.     "OrderNum": 0,
  99.     "i": 1,
  100.     "CodeName": "入库类型",
  101.     "UserRange": null
  102. },
  103. {
  104.     "OptionId": "4724939579473397712",
  105.     "CodeId": "",
  106.     "OptionVal": "退货入库",
  107.     "OptionCode": "2",
  108.     "IsReadOnly": false,
  109.     "StartValue": null,
  110.     "State": 1,
  111.     "CreateOn": "2017-06-26T18:10:36.367+08:00",
  112.     "CreaterId": "100001",
  113.     "UpdateOn": null,
  114.     "UpdaterId": null,
  115.     "OrderNum": 0,
  116.     "i": 2,
  117.     "CodeName": "入库类型",
  118.     "UserRange": null
  119. },
  120. {
  121.     "OptionId": "4614644976470649751",
  122.     "CodeId": "",
  123.     "OptionVal": "调拨入库",
  124.     "OptionCode": "2",
  125.     "IsReadOnly": false,
  126.     "StartValue": null,
  127.     "State": 1,
  128.     "CreateOn": "2017-06-26T18:10:47.42+08:00",
  129.     "CreaterId": "100001",
  130.     "UpdateOn": "2017-06-29T10:14:14.457+08:00",
  131.     "UpdaterId": "100001",
  132.     "OrderNum": 0,
  133.     "i": 3,
  134.     "CodeName": "入库类型",
  135.     "UserRange": null
  136. },
  137. {
  138.     "OptionId": "5510882356958338314",
  139.     "CodeId": "",
  140.     "OptionVal": "领用退料",
  141.     "OptionCode": "2",
  142.     "IsReadOnly": false,
  143.     "StartValue": null,
  144.     "State": 1,
  145.     "CreateOn": "2017-06-26T18:10:58.53+08:00",
  146.     "CreaterId": "100001",
  147.     "UpdateOn": null,
  148.     "UpdaterId": null,
  149.     "OrderNum": 0,
  150.     "i": 4,
  151.     "CodeName": "入库类型",
  152.     "UserRange": null
  153. },
  154. {
  155.     "OptionId": "5014288809117419600",
  156.     "CodeId": "",
  157.     "OptionVal": "次品入库",
  158.     "OptionCode": "2",
  159.     "IsReadOnly": false,
  160.     "StartValue": null,
  161.     "State": 1,
  162.     "CreateOn": "2017-06-26T18:11:08.077+08:00",
  163.     "CreaterId": "100001",
  164.     "UpdateOn": null,
  165.     "UpdaterId": null,
  166.     "OrderNum": 0,
  167.     "i": 5,
  168.     "CodeName": "入库类型",
  169.     "UserRange": null
  170. },
  171. {
  172.     "OptionId": "5078078002786611457",
  173.     "CodeId": "",
  174.     "OptionVal": "维修返库",
  175.     "OptionCode": "2",
  176.     "IsReadOnly": false,
  177.     "StartValue": null,
  178.     "State": 1,
  179.     "CreateOn": "2017-06-26T18:11:18.26+08:00",
  180.     "CreaterId": "100001",
  181.     "UpdateOn": null,
  182.     "UpdaterId": null,
  183.     "OrderNum": 0,
  184.     "i": 6,
  185.     "CodeName": "入库类型",
  186.     "UserRange": null
  187. },
  188. {
  189.     "OptionId": "5398365464964299655",
  190.     "CodeId": "",
  191.     "OptionVal": "生产入库",
  192.     "OptionCode": "2",
  193.     "IsReadOnly": false,
  194.     "StartValue": null,
  195.     "State": 1,
  196.     "CreateOn": "2017-06-26T18:11:27.84+08:00",
  197.     "CreaterId": "100001",
  198.     "UpdateOn": "2017-06-28T18:30:28.22+08:00",
  199.     "UpdaterId": "100001",
  200.     "OrderNum": 0,
  201.     "i": 7,
  202.     "CodeName": "入库类型",
  203.     "UserRange": null
  204. },
  205. {
  206.     "OptionId": "5390677822872245722",
  207.     "CodeId": "",
  208.     "OptionVal": "车间成品入库",
  209.     "OptionCode": "2",
  210.     "IsReadOnly": true,
  211.     "StartValue": null,
  212.     "State": 1,
  213.     "CreateOn": "2017-09-21T13:02:29.753+08:00",
  214.     "CreaterId": "5179720109629056025",
  215.     "UpdateOn": null,
  216.     "UpdaterId": null,
  217.     "OrderNum": 0,
  218.     "i": 8,
  219.     "CodeName": "入库类型",
  220.     "UserRange": null
  221. },
  222. {
  223.     "OptionId": "5369317315230155872",
  224.     "CodeId": "",
  225.     "OptionVal": "销售退库",
  226.     "OptionCode": "2",
  227.     "IsReadOnly": true,
  228.     "StartValue": null,
  229.     "State": 1,
  230.     "CreateOn": "2017-09-21T13:02:57.743+08:00",
  231.     "CreaterId": "5179720109629056025",
  232.     "UpdateOn": null,
  233.     "UpdaterId": null,
  234.     "OrderNum": 0,
  235.     "i": 9,
  236.     "CodeName": "入库类型",
  237.     "UserRange": null
  238. },
  239. {
  240.     "OptionId": "5052782331419521892",
  241.     "CodeId": "",
  242.     "OptionVal": "领用退库",
  243.     "OptionCode": "2",
  244.     "IsReadOnly": true,
  245.     "StartValue": null,
  246.     "State": 1,
  247.     "CreateOn": "2017-09-21T13:03:06.083+08:00",
  248.     "CreaterId": "5179720109629056025",
  249.     "UpdateOn": null,
  250.     "UpdaterId": null,
  251.     "OrderNum": 0,
  252.     "i": 10,
  253.     "CodeName": "入库类型",
  254.     "UserRange": null
  255. },
  256. {
  257.     "OptionId": "5104800241794207439",
  258.     "CodeId": "",
  259.     "OptionVal": "其他入库",
  260.     "OptionCode": "2",
  261.     "IsReadOnly": true,
  262.     "StartValue": null,
  263.     "State": 1,
  264.     "CreateOn": "2017-09-21T13:04:37.39+08:00",
  265.     "CreaterId": "5179720109629056025",
  266.     "UpdateOn": null,
  267.     "UpdaterId": null,
  268.     "OrderNum": 0,
  269.     "i": 11,
  270.     "CodeName": "入库类型",
  271.     "UserRange": null
  272. }]
复制代码


附件: 你需要登录才可以下载或查看附件。没有帐号?立即注册

Rank: 8Rank: 8

沙发
发表于 2017-10-9 14:47:42 |只看该作者
ondrawgroup="onDrwaGroup"
function onDrwaGroup(e){
   e.cellHtml = e.value;
}

Rank: 2

板凳
发表于 2017-10-10 08:45:09 |只看该作者
felt 发表于 2017-10-9 14:47
ondrawgroup="onDrwaGroup"
function onDrwaGroup(e){
   e.cellHtml = e.value;

O(∩_∩)O好的,谢谢版主

Archiver|普加软件

GMT+8, 2024-4-28 22:38 , Processed in 1.072832 second(s), 10 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部