forked from fanruan/fineui
Browse Source
* commit '103b10584503381a1678dfaa72ec1e9f8ffd19db': 添加popover, searcherview和popup_view的demoes6
windy
7 years ago
5 changed files with 288 additions and 5 deletions
@ -0,0 +1,56 @@
|
||||
/** |
||||
* Created by Windy on 2017/12/13. |
||||
*/ |
||||
Demo.Func = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "demo-func" |
||||
}, |
||||
render: function () { |
||||
var id = BI.UUID(); |
||||
return { |
||||
type: "bi.text_button", |
||||
text: "点击弹出Popover", |
||||
width: 200, |
||||
height: 80, |
||||
handler: function() { |
||||
BI.Popovers.remove(id); |
||||
BI.Popovers.create(id, new Demo.ExamplePopoverSection()).open(id); |
||||
} |
||||
}; |
||||
} |
||||
}); |
||||
|
||||
Demo.ExamplePopoverSection = BI.inherit(BI.PopoverSection, { |
||||
|
||||
rebuildSouth: function (south) { |
||||
var self = this, o = this.options; |
||||
this.sure = BI.createWidget({ |
||||
type: 'bi.button', |
||||
text: "确定", |
||||
warningTitle: o.warningTitle, |
||||
height: 30, |
||||
value: 0, |
||||
handler: function (v) { |
||||
self.end(); |
||||
self.close(v); |
||||
} |
||||
}); |
||||
this.cancel = BI.createWidget({ |
||||
type: 'bi.button', |
||||
text: "取消", |
||||
height: 30, |
||||
value: 1, |
||||
level: 'ignore', |
||||
handler: function (v) { |
||||
self.close(v); |
||||
} |
||||
}); |
||||
BI.createWidget({ |
||||
type: 'bi.right_vertical_adapt', |
||||
element: south, |
||||
lgap: 10, |
||||
items: [this.cancel, this.sure] |
||||
}); |
||||
} |
||||
}); |
||||
BI.shortcut("demo.popover", Demo.Func); |
@ -0,0 +1,42 @@
|
||||
/** |
||||
* Created by Windy on 2017/12/13. |
||||
*/ |
||||
Demo.Func = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "demo-func" |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
return { |
||||
type: "bi.absolute", |
||||
items: [{ |
||||
el: { |
||||
type: "bi.combo", |
||||
width: 200, |
||||
height: 30, |
||||
el: { |
||||
type: "bi.text_button", |
||||
text: "点击", |
||||
cls: "bi-border", |
||||
height: 30 |
||||
}, |
||||
popup: { |
||||
type: "bi.popup_view", |
||||
el: { |
||||
type: "bi.button_group", |
||||
layouts: [{ |
||||
type: "bi.vertical" |
||||
}], |
||||
items: BI.createItems(BI.deepClone(Demo.CONSTANTS.ITEMS), { |
||||
type: "bi.multi_select_item", |
||||
height: 25 |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
}] |
||||
}; |
||||
} |
||||
}); |
||||
BI.shortcut("demo.popup_view", Demo.Func); |
@ -0,0 +1,45 @@
|
||||
/** |
||||
* Created by Windy on 2017/12/13. |
||||
*/ |
||||
Demo.Func = BI.inherit(BI.Widget, { |
||||
props: { |
||||
baseCls: "demo-func" |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
return { |
||||
type: "bi.absolute", |
||||
items: [{ |
||||
el: { |
||||
type: "bi.searcher_view", |
||||
ref: function () { |
||||
self.searcherView = this; |
||||
} |
||||
}, |
||||
left: 100, |
||||
top: 20, |
||||
width: 230 |
||||
}] |
||||
}; |
||||
}, |
||||
|
||||
mounted: function () { |
||||
this.searcherView.populate(BI.createItems([{ |
||||
text: 2012 |
||||
}, { |
||||
text: 2013 |
||||
}, { |
||||
text: 2014 |
||||
}, { |
||||
text: 2015 |
||||
}], { |
||||
type: "bi.label", |
||||
textHeight: 24, |
||||
height: 24 |
||||
}), [{ |
||||
text: 2 |
||||
}], "2"); |
||||
} |
||||
}); |
||||
BI.shortcut("demo.searcher_view", Demo.Func); |
Loading…
Reference in new issue