|
本帖最后由 tengzhaoxing 于 2019-12-21 22:11 编辑
http://bbs.wex5.com/forum.php?mod=viewthread&tid=215875&extra=,前贴。this.getElementByXid(xid)这个语法怎么用,能详细解释下么,能否举例说明,或者有相关文档说明。查了论坛里的帖子:http://bbs.wex5.com/thread-75999-1-1.html,按上面的说法是先取得组件,再设置属性,但还是会报xxxx is not a function错误,如果把xid改成id,用document.getElementById就没问题,说明牛刀在这块的兼容性很差呀
<input bind-ref="$model.commonData.ref("fshoukuanje")" class="form-control c-36text" component="$UI/system/components/justep/input/input" oninput="OnInput (event)" style="height:100%" xid="input" />
<script type="text/javascript">// Firefox, Google Chrome, Opera, Safari, Internet Explorer from version 9
function OnInput (event) {
//alert ("The new content: " + event.target.value);
var input = this.getElementByXid('button');
input.setAttribute("disabled", "false");
}</script>
提示TypeError: this.getElementByXid is not a function
用document.getElementById("input").disabled=ture很简单就能做到的事情,在wex5里面怎么这么麻烦呢。
PS:如果有办法在这个function能够做到给this.getElementByXid('input')赋属性,那是不是也可以做到给this.comp()做setValue甚至做send请求操作呢?急于求解!
|
|