jQuery MiniUI

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

gird 格式问题 [复制链接]

Rank: 4

跳转到指定楼层
楼主
发表于 2012-12-10 15:21:10 |只看该作者 |倒序浏览
本帖最后由 dapang 于 2012-12-10 15:23 编辑

结构与数据如下:
[{xm1:9340,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:7255,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:0,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:24200,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:19700,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:0,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:7,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:113200,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:8700,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:134200,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:78000,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0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10:0,xm11:0,xm12:0,xm13:0},{xm1:0,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:0,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:0,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:0,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:0,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:0,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0},{xm1:0,xm2:0,xm3:0,xm4:0,xm5:0,xm6:0,xm7:0,xm8:0,xm9:0,xm10:0,xm11:0,xm12:0,xm13:0}]

var columns = [{ "field": "xm0", "width": "100", "headerAlign": "center", "header": "项目" }, { "field": "xm1", "width": "100", "headerAlign": "center", "header": "年计划" }, { "field": "xm2", "width": "100", "headerAlign": "center", "header": "一月" }, { "field": "xm3", "width": "100", "headerAlign": "center", "header": "二月" }, { "field": "xm4", "width": "100", "headerAlign": "center", "header": "三月" }, { "field": "xm5", "width": "100", "headerAlign": "center", "header": "四月" }, { "field": "xm6", "width": "100", "headerAlign": "center", "header": "五月" }, { "field": "xm7", "width": "100", "headerAlign": "center", "header": "六月" }, { "field": "xm8", "width": "100", "headerAlign": "center", "header": "七月" }, { "field": "xm9", "width": "100", "headerAlign": "center", "header": "八月" }, { "field": "xm10", "width": "100", "headerAlign": "center", "header": "九月" }, { "field": "xm11", "width": "100", "headerAlign": "center", "header": "十月" }, { "field": "xm12", "width": "100", "headerAlign": "center", "header": "十一月" }, { "field": "xm13", "width": "100", "headerAlign": "center", "header": "十二月"}];
grid.setColumns(columns);
grid.reload();


结果:

为什么会多出红圈的那一块?如何去掉?另外,我已经设置allowcelledit="true",allowcellselect="true",可是单元格无法编辑
附件: 你需要登录才可以下载或查看附件。没有帐号?立即注册

Rank: 8Rank: 8

沙发
发表于 2012-12-10 15:41:36 |只看该作者
设置fitColumns为true试试

Rank: 4

板凳
发表于 2012-12-10 15:45:30 |只看该作者
factory 发表于 2012-12-10 15:41
设置fitColumns为true试试

设置了,没有效果

Rank: 9Rank: 9Rank: 9

地板
发表于 2012-12-10 15:50:20 |只看该作者
目前锁定列后,最右侧会有一点空白,目前没办法解决,影响也不大。

Rank: 4

5#
发表于 2012-12-10 16:16:26 |只看该作者
niko 发表于 2012-12-10 15:50
目前锁定列后,最右侧会有一点空白,目前没办法解决,影响也不大。

明白了,谢谢

Archiver|普加软件

GMT+8, 2024-11-27 07:26 , Processed in 1.065372 second(s), 11 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部