起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1602|回复: 1

[处理中3] wex5 动态生成组件

[复制链接]

2

主题

6

帖子

13

积分

新手上路

Rank: 1

积分
13
QQ
发表于 2018-8-14 14:21:16 | 显示全部楼层 |阅读模式
动态生成组件 justep.Bind.addNodes(parentNode, $(attachDiv ));
var idRandom = justep.UUID.createUUID();
                                        var attachDiv = '';
                                        attachDiv += '<div component="$model/UI2/system/components/justep/attachment/attachmentSimple" xid="attachmentSimple'
                                                        + p.attr_name + '" ';
                                        attachDiv += 'data-bind="component:{ref:$model.'+dataName+'.ref("'+p.attr_name+'"),name:\'$model/UI2/system/components/justep/attachment/attachmentSimple\'}" ';
                                        attachDiv += 'data-config="{"actionUrl":"http://***/mobileFileUpload"}" ';
                                        attachDiv += 'id="'
                                                        + idRandom
                                                        + '_attachmentSimple'
                                                        + p.attr_name
                                                        + '" actionurl="http://***/mobileFileUpload">';
                                        attachDiv += '<div class="x-attachment" xid="'
                                                        + p.attr_name + 'div4"  id="' + idRandom + '_'
                                                        + p.attr_name + 'div4"> ';
                                        attachDiv += '<div class="x-attachment-content x-card-border" xid="'
                                                        + p.attr_name
                                                        + 'div5"  id="'
                                                        + idRandom
                                                        + '_'
                                                        + p.attr_name + 'div5"> ';
                                        attachDiv += '<div class="x-doc-process" xid="'
                                                        + p.attr_name + 'div6"  id="' + idRandom + '_'
                                                        + p.attr_name + 'div6"> ';
                                        attachDiv += '<div class="progress-bar x-doc-process-bar" role="progressbar" style="width:0%;" xid="progressBar'
                                                        + p.attr_name
                                                        + '"  id="'
                                                        + idRandom
                                                        + '_progressBar' + p.attr_name + '"></div>';
                                        attachDiv += '</div>  ';
                                        attachDiv += '<div data-bind="foreach:$attachmentItems" xid="'
                                                        + p.attr_name
                                                        + 'div7"   id="'
                                                        + idRandom
                                                        + '_'
                                                        + p.attr_name
                                                        + 'div7" __component-context__="inline"></div>  ';
                                        attachDiv += '<div class="x-attachment-cell" data-bind="visible:$state.get() == \'upload\'" xid="'
                                                        + p.attr_name
                                                        + 'div10"  id="'
                                                        + idRandom
                                                        + '_'
                                                        + p.attr_name + 'div10"> ';
                                        attachDiv += '<div class="x-attachment-item x-item-upload" data-bind="visible:$state.get() == \'upload\'" xid="'
                                                        + p.attr_name + 'div11"  ';
                                        attachDiv += 'id="' + idRandom + '_' + p.attr_name
                                                        + 'div11" style="position: relative;">';
//                                        attachDiv += '<form style="position: absolute; top: -3px; right: -3px; bottom: -3px; left: -3px; display: none;"  >';
//                                        attachDiv += '<input type="file" name="userfile" accept="*/*" tabindex="-1" style="cursor: pointer; opacity: 0; position: relative; z-index: 999; width: 100%; height: 100%; overflow: hidden; display: none;"  >';
//                                        attachDiv += '</form><span style="display:none"></span>';
                                        attachDiv += '</div></div>  ';
                                        attachDiv += '<div class="x-attachment-cell" data-bind="visible:$state.get() == \'upload\' && $attachmentItems.get().length > 0" xid="'
                                                        + p.attr_name
                                                        + 'div12"  id="'
                                                        + idRandom
                                                        + '_'
                                                        + p.attr_name + 'div12" style="display: none;"> ';
                                        attachDiv += '<div class="x-attachment-item x-item-remove" data-bind="click:changeState.bind($object,\'remove\')" xid="'
                                                        + p.attr_name
                                                        + 'div13"  id="'
                                                        + idRandom
                                                        + '_'
                                                        + p.attr_name + 'div13"></div>';
                                        attachDiv += '</div><div style="clear:both;" xid="'
                                                        + p.attr_name + 'div14" id="' + idRandom + '_'
                                                        + p.attr_name
                                                        + 'div14"></div></div></div></div>';

这样添加的上传文件组件。不好用。谁有好的解决办法

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36044
发表于 2018-8-14 17:19:32 | 显示全部楼层
attachmentSimple目前不支持动态生成
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-9-24 19:14 , Processed in 0.121242 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表