找回密码
 立即注册

QQ登录

只需一步,快速开始

大白菜
中级会员   /  发表于:2018-5-22 10:39:29
11#
ClarkPan 发表于 2018-5-21 16:51
循环是要我不清楚具体哪个单元格需要日期,我要循环拿数据判断具体是哪个单元格需要日期。---sheet.getCell ...

获取单元格值我知道的,现在重点是给一个单元格赋值日期;
回复 使用道具 举报
Clark.Pan讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-5-22 11:39:01
12#
我就不明白了,您给的代码中是循环,但是循环中的内容根本没有用到循环。所以看代码根本不明白您想干什么。 这样您具体说一下您具体想实现一个什么功能吧。
另外sheet.getCell(2, 2).text(0, 1, "DatePicker");   与sheet.getCell(2, 2).text(0);这个是一样的,text方法中有种一个参数,多传了也是无用,但是这明显不是您想要的效果吧。
回复 使用道具 举报
大白菜
中级会员   /  发表于:2018-5-22 12:17:04
13#
ClarkPan 发表于 2018-5-22 11:39
我就不明白了,您给的代码中是循环,但是循环中的内容根本没有用到循环。所以看代码根本不明白您想干什么。 ...

不好意思啊,那个循环有个判断,我去掉了。先不管循环吧。------我现在想实现单元格弹出日期;v9版本

-----我初始化一个空白的表格,下面的方法能实现单个单元格弹出日期
---如果我是有数据的表格,他就是多个单元格都是日期控件了。
        var range = sheet.getCell(6,5);
        range.cellType(new DatePickerCellType());



---这是模板数据,控制了几个单元格可编辑,其他锁定了。 坐标6,5 的需要日期   ------麻烦了。
"{\"version\":\"9.40.20153.0\",\"namedStyles\":[{\"name\":\"20% - Accent2\",\"backColor\":\"Accent 2 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent5\",\"backColor\":\"Accent 5 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"20% - Accent6\",\"backColor\":\"Accent 6 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"20% - Accent4\",\"backColor\":\"Accent 4 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent6\",\"backColor\":\"Accent 6 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent2\",\"backColor\":\"Accent 2 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent1\",\"backColor\":\"Accent 1 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"60% - Accent2\",\"backColor\":\"Accent 2 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"20% - Accent5\",\"backColor\":\"Accent 5 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"60% - Accent5\",\"backColor\":\"Accent 5 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"超链接\",\"foreColor\":\"#0000FF\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"textDecoration\":1},{\"name\":\"Accent1\",\"backColor\":\"Accent 1 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Calculation\",\"backColor\":\"#F2F2F2\",\"foreColor\":\"#FA7D00\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\",\"borderLeft\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderTop\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderRight\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderBottom\":{\"color\":\"#7F7F7F\",\"style\":1}},{\"name\":\"Check Cell\",\"backColor\":\"#A5A5A5\",\"foreColor\":\"#FFFFFF\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\",\"borderLeft\":{\"color\":\"#3F3F3F\",\"style\":6},\"borderTop\":{\"color\":\"#3F3F3F\",\"style\":6},\"borderRight\":{\"color\":\"#3F3F3F\",\"style\":6},\"borderBottom\":{\"color\":\"#3F3F3F\",\"style\":6}},{\"name\":\"60% - Accent4\",\"backColor\":\"Accent 4 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Comma [0]\",\"formatter\":\"_ * #,##0_ ;_ * \\\\-#,##0_ ;_ * \\\"-\\\"_ ;_ @_ \"},{\"name\":\"Linked Cell\",\"foreColor\":\"#FA7D00\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"borderBottom\":{\"color\":\"#FF8001\",\"style\":6}},{\"name\":\"20% - Accent3\",\"backColor\":\"Accent 3 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Normal\",\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"locked\":true,\"wordWrap\":false},{\"name\":\"Heading 4\",\"foreColor\":\"Text 2 0\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Percent\",\"formatter\":\"0%\"},{\"name\":\"Input\",\"backColor\":\"#FFCC99\",\"foreColor\":\"#3F3F76\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"borderLeft\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderTop\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderRight\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderBottom\":{\"color\":\"#7F7F7F\",\"style\":1}},{\"name\":\"Title\",\"foreColor\":\"Text 2 0\",\"font\":\"normal bold 24px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Total\",\"foreColor\":\"Text 1 0\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\",\"borderTop\":{\"color\":\"Accent 1 0\",\"style\":1},\"borderBottom\":{\"color\":\"Accent 1 0\",\"style\":6}},{\"name\":\"Note\",\"backColor\":\"#FFFFCC\",\"borderLeft\":{\"color\":\"#B2B2B2\",\"style\":1},\"borderTop\":{\"color\":\"#B2B2B2\",\"style\":1},\"borderRight\":{\"color\":\"#B2B2B2\",\"style\":1},\"borderBottom\":{\"color\":\"#B2B2B2\",\"style\":1}},{\"name\":\"Currency [0]\",\"formatter\":\"_ \\\"¥\\\"* #,##0_ ;_ \\\"¥\\\"* \\\\-#,##0_ ;_ \\\"¥\\\"* \\\"-\\\"_ ;_ @_ \"},{\"name\":\"Warning Text\",\"foreColor\":\"#FF0000\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Explanatory Text\",\"foreColor\":\"#7F7F7F\",\"font\":\"italic normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Output\",\"backColor\":\"#F2F2F2\",\"foreColor\":\"#3F3F3F\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\",\"borderLeft\":{\"color\":\"#3F3F3F\",\"style\":1},\"borderTop\":{\"color\":\"#3F3F3F\",\"style\":1},\"borderRight\":{\"color\":\"#3F3F3F\",\"style\":1},\"borderBottom\":{\"color\":\"#3F3F3F\",\"style\":1}},{\"name\":\"Heading 1\",\"foreColor\":\"Text 2 0\",\"font\":\"normal bold 20px calibri\",\"themeFont\":\"Body\",\"borderBottom\":{\"color\":\"Accent 1 0\",\"style\":2}},{\"name\":\"Heading 2\",\"foreColor\":\"Text 2 0\",\"font\":\"normal bold 17.3px calibri\",\"themeFont\":\"Body\",\"borderBottom\":{\"color\":\"Accent 1 0\",\"style\":2}},{\"name\":\"Good\",\"backColor\":\"#C6EFCE\",\"foreColor\":\"#006100\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Currency\",\"formatter\":\"_ \\\"¥\\\"* #,##0.00_ ;_ \\\"¥\\\"* \\\\-#,##0.00_ ;_ \\\"¥\\\"* \\\"-\\\"??_ ;_ @_ \"},{\"name\":\"Neutral\",\"backColor\":\"#FFEB9C\",\"foreColor\":\"#9C6500\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Accent3\",\"backColor\":\"Accent 3 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Accent6\",\"backColor\":\"Accent 6 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Accent4\",\"backColor\":\"Accent 4 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Accent5\",\"backColor\":\"Accent 5 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Heading 3\",\"foreColor\":\"Text 2 0\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\",\"borderBottom\":{\"color\":\"Accent 1 49\",\"style\":2}},{\"name\":\"60% - Accent6\",\"backColor\":\"Accent 6 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent3\",\"backColor\":\"Accent 3 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Bad\",\"backColor\":\"#FFC7CE\",\"foreColor\":\"#9C0006\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Accent2\",\"backColor\":\"Accent 2 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Comma\",\"formatter\":\"_ * #,##0.00_ ;_ * \\\\-#,##0.00_ ;_ * \\\"-\\\"??_ ;_ @_ \"},{\"name\":\"60% - Accent3\",\"backColor\":\"Accent 3 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"已访问的超链接\",\"foreColor\":\"#800080\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"textDecoration\":1},{\"name\":\"60% - Accent1\",\"backColor\":\"Accent 1 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent4\",\"backColor\":\"Accent 4 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"20% - Accent1\",\"backColor\":\"Accent 1 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"__builtInStyle49\",\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"locked\":true,\"wordWrap\":false},{\"name\":\"__builtInStyle50\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 24px 方正小标宋简体\",\"locked\":true,\"wordWrap\":false},{\"name\":\"__builtInStyle51\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 宋体\",\"locked\":true,\"wordWrap\":false},{\"name\":\"__builtInStyle52\",\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14px 宋体\",\"locked\":true,\"wordWrap\":false,\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle53\",\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"locked\":true,\"wordWrap\":false},{\"name\":\"__builtInStyle54\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderLeft\":{\"color\":\"#000000\",\"style\":1},\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderRight\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle55\",\"foreColor\":\"Text 1 0\",\"hAlign\":2,\"vAlign\":1,\"font\":\"normal normal 14px 宋体\",\"locked\":true,\"wordWrap\":true,\"borderLeft\":{\"color\":\"#000000\",\"style\":1},\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle56\",\"foreColor\":\"Text 1 0\",\"hAlign\":2,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle57\",\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle58\",\"backColor\":\"Text 2 0\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle59\",\"backColor\":\"Background 2 0\",\"foreColor\":\"Text 1 0\",\"hAlign\":2,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderLeft\":{\"color\":\"#000000\",\"style\":1},\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle60\",\"backColor\":\"Background 2 0\",\"foreColor\":\"Text 1 0\",\"hAlign\":2,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle61\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle62\",\"foreColor\":\"Text 1 0\",\"hAlign\":2,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderLeft\":{\"color\":\"#000000\",\"style\":1},\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle63\",\"backColor\":\"Text 2 0\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderRight\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle64\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderRight\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}}],\"sheets\":{\"Sheet1\":{\"name\":\"Sheet1\",\"defaults\":{\"rowHeight\":18.0,\"colWidth\":63.0,\"colHeaderRowHeight\":20.25,\"rowHeaderColWidth\":40.0},\"rowCount\":29,\"columnCount\":11,\"columns\":[null,null,null,null,{\"size\":229.0},{\"size\":49.0},{\"size\":206.0},null,{\"size\":51.0},{\"size\":103.0},{\"size\":98.0}],\"rows\":[{\"size\":30.0},{\"size\":18.0},{\"size\":18.0},{\"size\":18.0},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":26.533333333333331},{\"size\":29.533333333333328},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":34.533333333333331},{\"size\":23.266666666666666},{\"size\":23.266666666666666},{\"size\":23.266666666666666}],\"data\":{\"rowCount\":29,\"colCount\":11,\"dataTable\":{\"0\":{\"0\":{\"value\":\"侧额册啊饿饿测试\",\"style\":\"__builtInStyle50\"},\"1\":{\"style\":\"__builtInStyle50\"},\"2\":{\"style\":\"__builtInStyle50\"},\"3\":{\"style\":\"__builtInStyle50\"},\"4\":{\"style\":\"__builtInStyle50\"},\"5\":{\"style\":\"__builtInStyle50\"},\"6\":{\"style\":\"__builtInStyle50\"},\"7\":{\"style\":\"__builtInStyle50\"},\"8\":{\"style\":\"__builtInStyle50\"},\"9\":{\"style\":\"__builtInStyle50\"},\"10\":{\"style\":\"__builtInStyle50\"}},\"1\":{\"0\":{\"value\":\"阿诗丹顿撒多撒多撒\",\"style\":\"__builtInStyle51\"},\"1\":{\"style\":\"__builtInStyle51\"},\"2\":{\"style\":\"__builtInStyle51\"},\"3\":{\"style\":\"__builtInStyle51\"},\"4\":{\"style\":\"__builtInStyle51\"},\"5\":{\"style\":\"__builtInStyle51\"},\"6\":{\"style\":\"__builtInStyle51\"},\"7\":{\"style\":\"__builtInStyle51\"},\"8\":{\"style\":\"__builtInStyle51\"},\"9\":{\"style\":\"__builtInStyle51\"},\"10\":{\"style\":\"__builtInStyle51\"}},\"2\":{\"0\":{\"style\":\"__builtInStyle51\"},\"1\":{\"style\":\"__builtInStyle51\"},\"2\":{\"style\":\"__builtInStyle51\"},\"3\":{\"style\":\"__builtInStyle51\"},\"4\":{\"style\":\"__builtInStyle51\"},\"5\":{\"style\":\"__builtInStyle51\"},\"6\":{\"style\":\"__builtInStyle51\"},\"7\":{\"style\":\"__builtInStyle51\"},\"8\":{\"style\":\"__builtInStyle51\"},\"9\":{\"style\":\"__builtInStyle51\"},\"10\":{\"style\":\"__builtInStyle51\"}},\"3\":{\"1\":{\"value\":\"text\",\"style\":\"__builtInStyle52\"},\"6\":{\"value\":\" \",\"style\":\"__builtInStyle53\"},\"0\":{\"style\":\"__builtInStyle52\"},\"2\":{\"style\":\"__builtInStyle52\"},\"3\":{\"style\":\"__builtInStyle52\"},\"4\":{\"style\":\"__builtInStyle53\"},\"5\":{\"style\":\"__builtInStyle53\"},\"7\":{\"style\":\"__builtInStyle53\"},\"8\":{\"style\":\"__builtInStyle53\"},\"9\":{\"style\":\"__builtInStyle53\"},\"10\":{\"style\":\"__builtInStyle53\"}},\"4\":{\"1\":{\"value\":\"打大萨达:        \",\"style\":\"__builtInStyle55\"},\"0\":{\"style\":\"__builtInStyle54\"},\"2\":{\"style\":\"__builtInStyle56\"},\"3\":{\"style\":\"__builtInStyle56\"},\"4\":{\"style\":\"__builtInStyle56\"},\"5\":{\"style\":\"__builtInStyle57\"},\"6\":{\"style\":\"__builtInStyle58\"},\"7\":{\"style\":\"__builtInStyle58\"},\"8\":{\"style\":\"__builtInStyle58\"},\"9\":{\"style\":\"__builtInStyle58\"},\"10\":{\"style\":\"__builtInStyle63\"}},\"5\":{\"1\":{\"value\":\"$time                                                        \",\"style\":\"__builtInStyle59\"},\"0\":{\"style\":\"__builtInStyle54\"},\"2\":{\"style\":\"__builtInStyle60\"},\"3\":{\"style\":\"__builtInStyle60\"},\"4\":{\"style\":\"__builtInStyle60\"},\"5\":{\"style\":\"__builtInStyle61\"},\"6\":{\"style\":\"__builtInStyle61\"},\"7\":{\"style\":\"__builtInStyle61\"},\"8\":{\"style\":\"__builtInStyle61\"},\"9\":{\"style\":\"__builtInStyle61\"},\"10\":{\"style\":\"__builtInStyle64\"}},\"6\":{\"1\":{\"value\":\"$abc                \",\"style\":\"__builtInStyle62\"},\"5\":{\"value\":\"$namm\",\"style\":\"__builtInStyle61\"},\"0\":{\"style\":\"__builtInStyle54\"},\"2\":{\"style\":\"__builtInStyle56\"},\"3\":{\"style\":\"__builtInStyle56\"},\"4\":{\"style\":\"__builtInStyle56\"},\"6\":{\"style\":\"__builtInStyle61\"},\"7\":{\"style\":\"__builtInStyle61\"},\"8\":{\"style\":\"__builtInStyle61\"},\"9\":{\"style\":\"__builtInStyle61\"},\"10\":{\"style\":\"__builtInStyle64\"}}},\"columnDataArray\":[null,null,null,null,{\"style\":\"__builtInStyle49\"},{\"style\":\"__builtInStyle49\"},{\"style\":\"__builtInStyle49\"},null,{\"style\":\"__builtInStyle49\"},{\"style\":\"__builtInStyle49\"},{\"style\":\"__builtInStyle49\"}],\"defaultDataNode\":{\"style\":{\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"locked\":true,\"wordWrap\":false}}},\"spans\":[{\"row\":0,\"col\":0,\"rowCount\":1,\"colCount\":11},{\"row\":1,\"col\":0,\"rowCount\":1,\"colCount\":11},{\"row\":4,\"col\":1,\"rowCount\":1,\"colCount\":4},{\"row\":4,\"col\":6,\"rowCount\":1,\"colCount\":5},{\"row\":5,\"col\":1,\"rowCount\":1,\"colCount\":4},{\"row\":5,\"col\":5,\"rowCount\":1,\"colCount\":6},{\"row\":6,\"col\":1,\"rowCount\":1,\"colCount\":4},{\"row\":6,\"col\":5,\"rowCount\":1,\"colCount\":6},{\"row\":4,\"col\":0,\"rowCount\":3,\"colCount\":1}],\"activeRow\":10,\"activeCol\":6,\"selections\":{\"0\":{\"row\":10,\"col\":6,\"rowCount\":1,\"colCount\":1}},\"theme\":\"Office2007\",\"conditionalFormats\":{},\"rowHeaderData\":{\"rowCount\":29,\"colCount\":1},\"colHeaderData\":{\"rowCount\":1,\"colCount\":11},\"namedStyles\":[{\"name\":\"20% - Accent2\",\"backColor\":\"Accent 2 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent5\",\"backColor\":\"Accent 5 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"20% - Accent6\",\"backColor\":\"Accent 6 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"20% - Accent4\",\"backColor\":\"Accent 4 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent6\",\"backColor\":\"Accent 6 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent2\",\"backColor\":\"Accent 2 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent1\",\"backColor\":\"Accent 1 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"60% - Accent2\",\"backColor\":\"Accent 2 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"20% - Accent5\",\"backColor\":\"Accent 5 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"60% - Accent5\",\"backColor\":\"Accent 5 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"超链接\",\"foreColor\":\"#0000FF\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"textDecoration\":1},{\"name\":\"Accent1\",\"backColor\":\"Accent 1 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Calculation\",\"backColor\":\"#F2F2F2\",\"foreColor\":\"#FA7D00\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\",\"borderLeft\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderTop\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderRight\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderBottom\":{\"color\":\"#7F7F7F\",\"style\":1}},{\"name\":\"Check Cell\",\"backColor\":\"#A5A5A5\",\"foreColor\":\"#FFFFFF\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\",\"borderLeft\":{\"color\":\"#3F3F3F\",\"style\":6},\"borderTop\":{\"color\":\"#3F3F3F\",\"style\":6},\"borderRight\":{\"color\":\"#3F3F3F\",\"style\":6},\"borderBottom\":{\"color\":\"#3F3F3F\",\"style\":6}},{\"name\":\"60% - Accent4\",\"backColor\":\"Accent 4 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Comma [0]\",\"formatter\":\"_ * #,##0_ ;_ * \\\\-#,##0_ ;_ * \\\"-\\\"_ ;_ @_ \"},{\"name\":\"Linked Cell\",\"foreColor\":\"#FA7D00\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"borderBottom\":{\"color\":\"#FF8001\",\"style\":6}},{\"name\":\"20% - Accent3\",\"backColor\":\"Accent 3 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Normal\",\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"locked\":true,\"wordWrap\":false},{\"name\":\"Heading 4\",\"foreColor\":\"Text 2 0\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Percent\",\"formatter\":\"0%\"},{\"name\":\"Input\",\"backColor\":\"#FFCC99\",\"foreColor\":\"#3F3F76\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"borderLeft\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderTop\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderRight\":{\"color\":\"#7F7F7F\",\"style\":1},\"borderBottom\":{\"color\":\"#7F7F7F\",\"style\":1}},{\"name\":\"Title\",\"foreColor\":\"Text 2 0\",\"font\":\"normal bold 24px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Total\",\"foreColor\":\"Text 1 0\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\",\"borderTop\":{\"color\":\"Accent 1 0\",\"style\":1},\"borderBottom\":{\"color\":\"Accent 1 0\",\"style\":6}},{\"name\":\"Note\",\"backColor\":\"#FFFFCC\",\"borderLeft\":{\"color\":\"#B2B2B2\",\"style\":1},\"borderTop\":{\"color\":\"#B2B2B2\",\"style\":1},\"borderRight\":{\"color\":\"#B2B2B2\",\"style\":1},\"borderBottom\":{\"color\":\"#B2B2B2\",\"style\":1}},{\"name\":\"Currency [0]\",\"formatter\":\"_ \\\"¥\\\"* #,##0_ ;_ \\\"¥\\\"* \\\\-#,##0_ ;_ \\\"¥\\\"* \\\"-\\\"_ ;_ @_ \"},{\"name\":\"Warning Text\",\"foreColor\":\"#FF0000\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Explanatory Text\",\"foreColor\":\"#7F7F7F\",\"font\":\"italic normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Output\",\"backColor\":\"#F2F2F2\",\"foreColor\":\"#3F3F3F\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\",\"borderLeft\":{\"color\":\"#3F3F3F\",\"style\":1},\"borderTop\":{\"color\":\"#3F3F3F\",\"style\":1},\"borderRight\":{\"color\":\"#3F3F3F\",\"style\":1},\"borderBottom\":{\"color\":\"#3F3F3F\",\"style\":1}},{\"name\":\"Heading 1\",\"foreColor\":\"Text 2 0\",\"font\":\"normal bold 20px calibri\",\"themeFont\":\"Body\",\"borderBottom\":{\"color\":\"Accent 1 0\",\"style\":2}},{\"name\":\"Heading 2\",\"foreColor\":\"Text 2 0\",\"font\":\"normal bold 17.3px calibri\",\"themeFont\":\"Body\",\"borderBottom\":{\"color\":\"Accent 1 0\",\"style\":2}},{\"name\":\"Good\",\"backColor\":\"#C6EFCE\",\"foreColor\":\"#006100\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Currency\",\"formatter\":\"_ \\\"¥\\\"* #,##0.00_ ;_ \\\"¥\\\"* \\\\-#,##0.00_ ;_ \\\"¥\\\"* \\\"-\\\"??_ ;_ @_ \"},{\"name\":\"Neutral\",\"backColor\":\"#FFEB9C\",\"foreColor\":\"#9C6500\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Accent3\",\"backColor\":\"Accent 3 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Accent6\",\"backColor\":\"Accent 6 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Accent4\",\"backColor\":\"Accent 4 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Accent5\",\"backColor\":\"Accent 5 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Heading 3\",\"foreColor\":\"Text 2 0\",\"font\":\"normal bold 14.7px calibri\",\"themeFont\":\"Body\",\"borderBottom\":{\"color\":\"Accent 1 49\",\"style\":2}},{\"name\":\"60% - Accent6\",\"backColor\":\"Accent 6 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent3\",\"backColor\":\"Accent 3 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Bad\",\"backColor\":\"#FFC7CE\",\"foreColor\":\"#9C0006\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Accent2\",\"backColor\":\"Accent 2 0\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"Comma\",\"formatter\":\"_ * #,##0.00_ ;_ * \\\\-#,##0.00_ ;_ * \\\"-\\\"??_ ;_ @_ \"},{\"name\":\"60% - Accent3\",\"backColor\":\"Accent 3 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"已访问的超链接\",\"foreColor\":\"#800080\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"textDecoration\":1},{\"name\":\"60% - Accent1\",\"backColor\":\"Accent 1 39\",\"foreColor\":\"Background 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"40% - Accent4\",\"backColor\":\"Accent 4 59\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"20% - Accent1\",\"backColor\":\"Accent 1 79\",\"foreColor\":\"Text 1 0\",\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\"},{\"name\":\"__builtInStyle49\",\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"locked\":true,\"wordWrap\":false},{\"name\":\"__builtInStyle50\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 24px 方正小标宋简体\",\"locked\":true,\"wordWrap\":false},{\"name\":\"__builtInStyle51\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 宋体\",\"locked\":true,\"wordWrap\":false},{\"name\":\"__builtInStyle52\",\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14px 宋体\",\"locked\":true,\"wordWrap\":false,\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle53\",\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14.7px calibri\",\"themeFont\":\"Body\",\"locked\":true,\"wordWrap\":false},{\"name\":\"__builtInStyle54\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderLeft\":{\"color\":\"#000000\",\"style\":1},\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderRight\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle55\",\"foreColor\":\"Text 1 0\",\"hAlign\":2,\"vAlign\":1,\"font\":\"normal normal 14px 宋体\",\"locked\":true,\"wordWrap\":true,\"borderLeft\":{\"color\":\"#000000\",\"style\":1},\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle56\",\"foreColor\":\"Text 1 0\",\"hAlign\":2,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle57\",\"foreColor\":\"Text 1 0\",\"hAlign\":3,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle58\",\"backColor\":\"Text 2 0\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle59\",\"backColor\":\"Background 2 0\",\"foreColor\":\"Text 1 0\",\"hAlign\":2,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderLeft\":{\"color\":\"#000000\",\"style\":1},\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle60\",\"backColor\":\"Background 2 0\",\"foreColor\":\"Text 1 0\",\"hAlign\":2,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle61\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle62\",\"foreColor\":\"Text 1 0\",\"hAlign\":2,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderLeft\":{\"color\":\"#000000\",\"style\":1},\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle63\",\"backColor\":\"Text 2 0\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderRight\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}},{\"name\":\"__builtInStyle64\",\"foreColor\":\"Text 1 0\",\"hAlign\":1,\"vAlign\":1,\"font\":\"normal normal 14px 仿宋_GB2312\",\"locked\":true,\"wordWrap\":true,\"borderTop\":{\"color\":\"#000000\",\"style\":1},\"borderRight\":{\"color\":\"#000000\",\"style\":1},\"borderBottom\":{\"color\":\"#000000\",\"style\":1}}],\"rowRangeGroup\":{},\"colRangeGroup\":{},\"rowFilter\":null,\"allowCellOverflow\":true,\"index\":0,\"comments\":null,\"slicers\":null,\"printInfo\":{\"columnStart\":-1,\"columnEnd\":-1,\"rowStart\":-1,\"rowEnd\":-1,\"repeatColumnStart\":-1,\"repeatColumnEnd\":-1,\"repeatRowStart\":-1,\"repeatRowEnd\":-1,\"showBorder\":true,\"showGridLine\":true,\"showColumnHeader\":0,\"showRowHeader\":0,\"centering\":0,\"firstPageNumber\":1,\"headerLeft\":null,\"headerCenter\":null,\"headerRight\":null,\"footerLeft\":null,\"footerCenter\":null,\"footerRight\":null,\"headerLeftImage\":\"\",\"headerCenterImage\":\"\",\"headerRightImage\":\"\",\"footerLeftImage\":\"\",\"footerCenterImage\":\"\",\"footerRightImage\":\"\",\"margin\":{\"left\":100,\"top\":100,\"right\":100,\"bottom\":100,\"header\":50,\"footer\":50},\"orientation\":2,\"pageOrder\":1,\"blackAndWhite\":false,\"zoomFactor\":0.68000000715255737,\"fitPagesTall\":1,\"fitPagesWide\":1,\"paperSize\":{\"width\":826.77166596017173,\"height\":1169.2913561436715,\"kind\":9}}}},\"noRecalc\":false}"
回复 使用道具 举报
Clark.Pan讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-5-22 18:01:48
14#
var sheet = spread.getActiveSheet();
            sheet.isPaintSuspended(true);
                        var cell = sheet.getCell(6,5);
                        cell.value("datepicker")
                        cell.cellType(new DatePickerCellType());
                        cell.formatter("yyyy年MM月dd日");
                        sheet.setColumnWidth(5,100)
            sheet.isPaintSuspended(false);
回复 使用道具 举报
大白菜
中级会员   /  发表于:2018-5-23 08:37:28
15#
ClarkPan 发表于 2018-5-22 18:01
var sheet = spread.getActiveSheet();
            sheet.isPaintSuspended(true);
                        var cell = sheet ...

非常感谢,也非常抱歉,我查出原因了,是因为我设置为日期后,后面会给此单元格重新设置了样式,我测试是这个地方冲突了。也请光大朋友注意点。v9版本--设置 setStyle 和range.cellType(new DatePickerCellType()); ----- 冲突

评分

参与人数 1金币 +200 收起 理由
Clark.Pan + 200 这个问题很有帮助

查看全部评分

回复 使用道具 举报
Clark.Pan讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-5-23 14:15:39
16#
确实,因为style中也存在cellType与formatter这样的属性,所以会重新覆盖,这样写就不会冲突了
var style = new GcSpread.Sheets.Style();
style.backColor = "red";
style.borderLeft = new GcSpread.Sheets.LineBorder("blue");
style.borderTop = new GcSpread.Sheets.LineBorder("blue");
style.borderRight = new GcSpread.Sheets.LineBorder("blue");
style.borderBottom = new GcSpread.Sheets.LineBorder("blue");
style.cellType = new DatePickerCellType();
style.formatter = "yyyy年MM月dd日";
sheet.setStyle(6,5,style,GcSpread.Sheets.SheetArea.viewport);
将cellType与formatter在设置样式时一同进行设置。
回复 使用道具 举报
12
您需要登录后才可以回帖 登录 | 立即注册
返回顶部