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

QQ登录

只需一步,快速开始

12
返回列表 发新帖
楼主: 黑白

[处理中5] richtextarea组件设置问题

[复制链接]

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36044
发表于 2017-1-16 16:38:31 | 显示全部楼层
/UI2/system/components/justep/richTextarea/richTextarea.js文件中
  1. doChange : function() {
  2.                         var editor = this.getEditor();
  3.                         if(editor){
  4.                                 //解决editor的getContent方法自动追加<p>问题---遗留问题当原值为"text"时赋值后会变成"<p>text</p>触发valueChange"
  5.                                 var val = editor.getPlainTxt();
  6.                                 var refVal = justep.Bind.isObservable(this.ref) ? this.ref.get() : (this.ref instanceof justep.BindComponent.NullValue?"":this.ref);
  7.                                 if(val!=refVal && (val!=='' || (refVal!==undefined && refVal!==null))){
  8.                                         this.fireEvent('onChange', {
  9.                                                 'source' : this,
  10.                                                 'value' : editor.getContent()
  11.                                         });
  12.                                         this.val2ref();
  13.                                 }
  14.                         }
  15.                 },
复制代码


改为

  1. doChange : function() {
  2.                         var editor = this.getEditor();
  3.                         if(editor){
  4.                                 //解决editor的getContent方法自动追加<p>问题---遗留问题当原值为"text"时赋值后会变成"<p>text</p>触发valueChange"
  5.                                 var val = editor.getContentLength()>0?editor.getPlainTxt():'';
  6.                                 var refVal = justep.Bind.isObservable(this.ref) ? this.ref.get() : (this.ref instanceof justep.BindComponent.NullValue?"":this.ref);
  7.                                 if(val!=refVal && (val!=='' || (refVal!==undefined && refVal!==null))){
  8.                                         this.fireEvent('onChange', {
  9.                                                 'source' : this,
  10.                                                 'value' : editor.getContent()
  11.                                         });
  12.                                         this.val2ref();
  13.                                 }
  14.                         }
  15.                 },
复制代码


修改后参考http://docs.wex5.com/bex5-ui-question-list-10013/处理
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

12

主题

2627

帖子

2866

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2866
发表于 2017-4-24 18:01:16 | 显示全部楼层
V3.7版本已经解决
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-21 09:02 , Processed in 0.161838 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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