guy
7 years ago
32 changed files with 3744 additions and 3342 deletions
@ -1,46 +0,0 @@
|
||||
/** |
||||
* Created by Dailer on 2017/7/11. |
||||
*/ |
||||
Demo.AdaptEditor = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "" |
||||
}, |
||||
|
||||
|
||||
|
||||
//这东西好奇怪,不支持设置宽度,那么渲染出来宽度几乎没有,无奈之下只能假装给他个默认值了
|
||||
beforeMount: function () { |
||||
this.refs.setValue("Winter is coming !") |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
var editor = BI.createWidget({ |
||||
type: "bi.adapt_editor", |
||||
cls: "layout-bg5", |
||||
ref: function (_ref) { |
||||
self.refs = _ref; |
||||
} |
||||
}) |
||||
|
||||
var text=["You know nothing! Jon Snow","A Lannister always pays his debts.","Power is a curious thing."] |
||||
|
||||
return { |
||||
type: "bi.horizontal_auto", |
||||
items: [{ |
||||
el: editor |
||||
}, { |
||||
type: "bi.button", |
||||
text: "为了展示长度真的是可变的,每点一下就换一行字", |
||||
handler: function () { |
||||
var temp=text.shift(); |
||||
editor.setValue(temp); |
||||
text.push(temp); |
||||
} |
||||
}], |
||||
vgap: 20 |
||||
} |
||||
} |
||||
}) |
||||
|
||||
BI.shortcut("demo.adapt_editor", Demo.AdaptEditor); |
@ -0,0 +1,35 @@
|
||||
/* 文件管理导航 |
||||
Created by dailer on 2017 / 7 / 21. |
||||
*/ |
||||
Demo.FileManager = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "" |
||||
}, |
||||
|
||||
render: function () { |
||||
var editor = BI.createWidget({ |
||||
type: "bi.number_editor", |
||||
validationChecker: function (v) { |
||||
return BI.parseFloat(v) <= 100 && BI.parseFloat(v) >= 0 |
||||
}, |
||||
height: 24, |
||||
width: 150, |
||||
errorText: "hahah" |
||||
}); |
||||
editor.on(BI.NumberEditor.EVENT_CHANGE, function () { |
||||
if (BI.parseFloat(this.getValue()) < 1) { |
||||
editor.setDownEnable(false); |
||||
} else { |
||||
editor.setDownEnable(true); |
||||
} |
||||
}); |
||||
return { |
||||
type: "bi.vertical", |
||||
items: [{ |
||||
el: editor, |
||||
height: 24 |
||||
}] |
||||
} |
||||
} |
||||
}); |
||||
BI.shortcut("demo.number_editor", Demo.FileManager); |
@ -0,0 +1,46 @@
|
||||
/** |
||||
* Created by Dailer on 2017/7/26. |
||||
*/ |
||||
|
||||
|
||||
Demo.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, { |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
var tree = BI.createWidget({ |
||||
type: "bi.multilayer_select_level_tree", |
||||
items: BI.deepClone(Demo.CONSTANTS.TREE) |
||||
}); |
||||
|
||||
return { |
||||
type: "bi.vtape", |
||||
items: [{ |
||||
el: tree |
||||
}, { |
||||
el: { |
||||
type: "bi.button", |
||||
height: 25, |
||||
text: "getValue", |
||||
handler: function () { |
||||
BI.Msg.alert("", JSON.stringify(tree.getValue())); |
||||
} |
||||
}, |
||||
height: 25 |
||||
}, { |
||||
el: { |
||||
type: "bi.button", |
||||
height: 25, |
||||
text: "setValue (第二级文件1)", |
||||
handler: function () { |
||||
tree.setValue(["第二级文件1"]); |
||||
} |
||||
}, |
||||
height: 25 |
||||
}], |
||||
width: 500, |
||||
hgap: 300 |
||||
} |
||||
} |
||||
}); |
||||
|
||||
BI.shortcut("demo.multilayer_select_level_tree", Demo.MultiLayerSelectLevelTree); |
@ -0,0 +1,46 @@
|
||||
/** |
||||
* Created by Dailer on 2017/7/26. |
||||
*/ |
||||
|
||||
|
||||
Demo.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, { |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
var tree = BI.createWidget({ |
||||
type: "bi.multilayer_single_level_tree", |
||||
items: BI.deepClone(Demo.CONSTANTS.TREE) |
||||
}); |
||||
|
||||
return { |
||||
type: "bi.vtape", |
||||
items: [{ |
||||
el: tree |
||||
}, { |
||||
el: { |
||||
type: "bi.button", |
||||
height: 25, |
||||
text: "getValue", |
||||
handler: function () { |
||||
BI.Msg.alert("", JSON.stringify(tree.getValue())); |
||||
} |
||||
}, |
||||
height: 25 |
||||
}, { |
||||
el: { |
||||
type: "bi.button", |
||||
height: 25, |
||||
text: "setValue (第二级文件1)", |
||||
handler: function () { |
||||
tree.setValue(["第二级文件1"]); |
||||
} |
||||
}, |
||||
height: 25 |
||||
}], |
||||
width: 500, |
||||
hgap: 300 |
||||
} |
||||
} |
||||
}); |
||||
|
||||
BI.shortcut("demo.multilayer_single_level_tree", Demo.MultiLayerSingleLevelTree); |
@ -0,0 +1,46 @@
|
||||
/** |
||||
* Created by Dailer on 2017/7/26. |
||||
*/ |
||||
|
||||
|
||||
Demo.SelectLevelTree = BI.inherit(BI.Widget, { |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
var tree = BI.createWidget({ |
||||
type: "bi.select_level_tree", |
||||
items: BI.deepClone(Demo.CONSTANTS.LEVELTREE) |
||||
}); |
||||
|
||||
return { |
||||
type: "bi.vtape", |
||||
items: [{ |
||||
el: tree |
||||
}, { |
||||
el: { |
||||
type: "bi.button", |
||||
height: 25, |
||||
text: "getValue", |
||||
handler: function () { |
||||
BI.Msg.alert("", JSON.stringify(tree.getValue())); |
||||
} |
||||
}, |
||||
height: 25 |
||||
}, { |
||||
el: { |
||||
type: "bi.button", |
||||
height: 25, |
||||
text: "setValue (第二级文件1)", |
||||
handler: function () { |
||||
tree.setValue(["第二级文件1"]); |
||||
} |
||||
}, |
||||
height: 25 |
||||
}], |
||||
width: 500, |
||||
hgap: 300 |
||||
} |
||||
} |
||||
}); |
||||
|
||||
BI.shortcut("demo.select_level_tree", Demo.SelectLevelTree); |
@ -0,0 +1,46 @@
|
||||
/** |
||||
* Created by Dailer on 2017/7/26. |
||||
*/ |
||||
|
||||
|
||||
Demo.SingleLevelTree = BI.inherit(BI.Widget, { |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
var tree = BI.createWidget({ |
||||
type: "bi.single_level_tree", |
||||
items: BI.deepClone(Demo.CONSTANTS.LEVELTREE) |
||||
}); |
||||
|
||||
return { |
||||
type: "bi.vtape", |
||||
items: [{ |
||||
el: tree |
||||
}, { |
||||
el: { |
||||
type: "bi.button", |
||||
height: 25, |
||||
text: "getValue", |
||||
handler: function () { |
||||
BI.Msg.alert("", JSON.stringify(tree.getValue())); |
||||
} |
||||
}, |
||||
height: 25 |
||||
}, { |
||||
el: { |
||||
type: "bi.button", |
||||
height: 25, |
||||
text: "setValue (第二级文件1)", |
||||
handler: function () { |
||||
tree.setValue(["第二级文件1"]); |
||||
} |
||||
}, |
||||
height: 25 |
||||
}], |
||||
width: 500, |
||||
hgap: 300 |
||||
} |
||||
} |
||||
}); |
||||
|
||||
BI.shortcut("demo.single_level_tree", Demo.SingleLevelTree); |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue