📄 poll.js
字号:
Class('App.linb_UI_Poll', 'linb.Com',{ Instance:{ base:["linb.UI"], required:["linb.UI.Block", "linb.UI.Poll"], iniComponents:function(){ // [[code created by jsLinb UI Builder var host=this, children=[], append=function(child){children.push(child.get(0))}; append((new linb.UI.Block) .host(host,"block1") .setLeft(60) .setTop(20) .setWidth(553) .setHeight(600) .setBorder(true) .setResizer(true) .setBackground("#fff") ); host.block1.append((new linb.UI.Poll) .host(host,"poll05") .setItems([{"id":"a", "caption":"option 1", "message":"1", "percent":"0.1"}, {"id":"b", "caption":"option 2", "message":"90%", "percent":"0.9"}]) .setDisabled(true) .setLeft(null) .setTop(null) .setWidth("auto") .setHeight("auto") .setPosition("relative") .setTitle("5. single select (disabled)") .setValue("") ); host.block1.append((new linb.UI.Poll) .host(host,"poll02") .setItems([{"id":"a", "caption":"option 1", "message":"2", "percent":"0.2"}, {"id":"b", "caption":"option 2", "message":"80%", "percent":"0.8"}]) .setLeft(null) .setTop(null) .setWidth("auto") .setHeight("auto") .setPosition("relative") .setSelMode("multi") .setTitle("2. multi select ") .setValue("") ); host.block1.append((new linb.UI.Poll) .host(host,"poll06") .setItems([{"id":"a", "caption":"option 1", "message":"4", "percent":"0.4"}, {"id":"b", "caption":"option 2", "message":"60%", "percent":"0.6"}]) .setLeft(null) .setTop(null) .setWidth("auto") .setHeight("auto") .setPosition("relative") .setTitle("6. Editable ") .setEditable(true) .setValue("") ); host.block1.append((new linb.UI.Poll) .host(host,"poll03") .setItems([{"id":"a", "caption":"option 1", "message":"1", "percent":"0.1"}, {"id":"b", "caption":"option 2", "message":"90%", "percent":"0.9"}]) .setLeft(null) .setTop(null) .setWidth("auto") .setHeight("auto") .setPosition("relative") .setTitle("3. single select + new option") .setNewOption("new option") .setValue("") ); host.block1.append((new linb.UI.Poll) .host(host,"poll01") .setItems([{"id":"a", "caption":"option 1", "message":"1", "percent":"0.1"}, {"id":"b", "caption":"option 2", "message":"90%", "percent":"0.9"}]) .setLeft(null) .setTop(null) .setWidth("auto") .setHeight("auto") .setPosition("relative") .setTitle("1. single select ") .setToggle(true) .setValue("") .setCustomFunction({"formatCaption":function (s) { return s + "-"; }}) ); host.block1.append((new linb.UI.Poll) .host(host,"poll04") .setItems([{"id":"a", "caption":"option 1", "message":"2", "percent":"0"}, {"id":"b", "caption":"option 2", "message":"100%", "percent":"1"}]) .setLeft(null) .setTop(null) .setWidth("auto") .setHeight("auto") .setTabindex(3) .setPosition("relative") .setSelMode("multi") .setTitle("4. multi select + new option") .setCmds([{"id":"cast", "caption":"cast"}, {"id":"refuse", "caption":"refuse"}]) .setNewOption("new option") .setValue("") .onClickButton("_poll04_oncommand") ); return children; // ]]code created by jsLinb UI Builder }, _poll04_oncommand:function (profile, key, src) { linb.message(key+' was clicked!') } }});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -