progress 组件实现动态绑定

下面的代码你可以参考一下,progress组件放在list中感知没有行数据的progress值,注意这里的progress值要为'50%'这样的格式 bind-text 属性绑定data字段 或 ko对象就可以了! <div class="progress" component="$UI/system/components/bootstrap/progress/progress" xid="progress1"> <div class="progress-bar" role="progressbar" xid="progressBar1" bind-style="{width:val('progress')}" bind-css="{'progress-bar-success':val('state')=='success','progress-bar-info':val('state')!='success'}"> <span xid="span4" bind-text="val('progress')">0%</span> </div> </div>

js代码调用attachmentSimple组件弹出选择文件

attachmentSimple 组件就是封装的input type=file 的节点!attachmentSimple 没有提供API弹出选择资源的框!所以你自己试试,使用js 获取x-item-upload节点再调用它的click方法试试! 案例/UI2/system/components/justep/attachment/demo/demoSimple.w 的代码就是: var add = this.getElementByXid('div12'); $(add).children().children().click();

button组件关于icon的理解

icon设置为字体选择的样式,表示的是,分别在button 激活和不激活起作用,激活和不激活状态下显示不同的颜色! icon设置为img的时候,表示的是,button 禁用和启用时起作用。 如果想在button上设置激活和不激活状态下显示不同的图片,就需要通过js代码动态设置图片的rul,方法是: this.comp('buttonXid').set({ "icon" : "img:$UI/test/image/icon.png|" }); contents组件在onActiveChanged 事件中判断切换的content 并设置显示的icon图片 参考案例:http://bbs.wex5.com/forum.php?mod=redirect&goto=findpost&ptid=80603&pid=165185506

页面跳转传参 接收参数的问题

原因:我们提供的案例介绍 /UI2/demo/page/index.w http://docs.wex5.com/page-interaction/ 都是讲的,model的 onParamsReceive 接收参数的! 实际上!前一个页面传递过来的参数,在其他事件或者其他定义的js中直接就可以获取到的! 方法: 写法和onParamsReceive 中的格式 基本类似,就是将event换成this即可!! 比如onParamsReceive中 获取参数是 event.params.a1</pre> <pre>event.params.data.d1 那么onload 或者其他 方法 ,事件中得到参数的写法就是 this.params.a1 this.params.data.d1