-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
414 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
extends ../.cola | ||
append head | ||
style. | ||
.current > .tree.node .node-operation { | ||
display: inline-block; | ||
} | ||
.node-operation { | ||
display: none; | ||
float: right; | ||
padding-right: 0.5em; | ||
} | ||
.node-operation i{ | ||
margin-right: 0.5em; | ||
} | ||
|
||
block body | ||
#treeDropDown | ||
append scripts | ||
script. | ||
cola(function (model) { | ||
model.set("node", { | ||
nodes: [ | ||
{ | ||
name: "中国", | ||
nodes: [ | ||
{ | ||
name: "上海", | ||
nodes: [ | ||
{ | ||
name: "浦东新区" | ||
}, | ||
{ | ||
name: "杨浦" | ||
}, | ||
{ | ||
name: "松江" | ||
}, { | ||
name: "徐汇区" | ||
} | ||
] | ||
}, { | ||
name: "内蒙古", | ||
nodes: [ | ||
{ | ||
name: "兴安盟" | ||
}, { | ||
name: "通辽" | ||
}, { | ||
name: "锡林郭勒" | ||
}, { | ||
name: "呼伦贝尔" | ||
}, { | ||
name: "赤峰" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}); | ||
|
||
|
||
model.widgetConfig({ | ||
treeDropDown: { | ||
$type: "customDropdown", | ||
openMode: "drop", | ||
valueProperty: "name", | ||
dropDownHeight:400, | ||
content: { | ||
$type: "tree", | ||
tag:"dropdownTree", | ||
autoCollapse: false, | ||
autoExpand: true, | ||
|
||
highlightCurrentItem: true, | ||
bind: { | ||
recursive: true, | ||
expandedProperty: "expanded", | ||
textProperty: "name", | ||
expression: "node in node.nodes" | ||
}, | ||
itemClick: function (self, arg) { | ||
var dropdown = cola.findDropDown(self); | ||
|
||
if (dropdown) dropdown.close(arg.item.get("data")); | ||
} | ||
}, | ||
open:function(self,arg){ | ||
var tree=cola.tag("dropdownTree")[0]; | ||
var value=self.get("value"); | ||
var node=model.get("node"); | ||
console.log(node) | ||
debugger; | ||
tree.findNode() | ||
} | ||
|
||
} | ||
|
||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
extends ../.cola | ||
append head | ||
|
||
block body | ||
.ui.fragment(style="height: 100%; ") | ||
.ui.form(style="width:400px") | ||
.two.fields | ||
.field | ||
#MappingDropDown | ||
.field | ||
div(c-widget="button; caption:测试; click:showValue") | ||
#ProductTable | ||
append scripts | ||
script(src="./example/mapping.js") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
extends ../.cola | ||
append head | ||
link(rel="stylesheet", type="text/css", href="./example/table.css") | ||
block body | ||
.ui.fragment(style="height: 100%; ") | ||
div.secondary(c-widget="menu") | ||
a(c-widget="item; caption:获得已选列表; click:getSelections") | ||
div#productTable | ||
template(name="productName") | ||
div.product-name | ||
span(c-bind="item.name") | ||
template(name="select") | ||
div | ||
div(c-widget="checkbox;class:in-cell;bind:item.selected;" c-display="!selectable(item)") | ||
template(name="price") | ||
div | ||
div.mini(c-widget="input; bind:item.unitPrice; blur:blur") | ||
span.btn | ||
i.edit.icon | ||
span(c-bind="formatNumber(item.unitPrice, '¥#,##0.00')") | ||
|
||
append scripts | ||
script(src="./example/table.js") |
Oops, something went wrong.