Item: {
xml: "<li id='item'/>"
},
List: {
xml: "<ul id='list'/>"
}
Example: {
xml: "<List id='example'>\
<Item>Item 1</Item>\
<Item>Item 2</Item>\
</List>"
}
Example: {
xml: "<div id='example'>\
<List id='list'/>\
<button id='append'>append</button>\
<button id='remove'>remove</button>\
<button id='modify'>modify</button>\
</div>",
fun: function (sys, items, opts) {
sys.append.on("click", function() {
sys.list.append("Item").text("Item 1");
});
sys.remove.on("click", function() {
sys.list.first() && sys.list.first().remove();
});
sys.modify.on("click", function() {
sys.list.first() && sys.list.first().text("Item 2");
});
}
}
Item: {
xml: "<li id='item'>\
<span id='color'>red</span>
<span id='shape'>square</span>
</li>",
fun: function (sys, items, opts) {
function getValue() {
return {color: sys.color.text(), shape: sys.shape.text()};
}
function setValue(obj) {
sys.color.text(obj.color);
sys.shape.text(obj.shape);
}
return Object.defineProperty({}, "data", { get: getValue, set: setValue});
}
}
Example: {
xml: "<div id='example'>\
<List id='list'/>\
<button id='append'>append</button>\
<button id='remove'>remove</button>\
<button id='modify'>modify</button>\
</List>",
fun: function (sys, items, opts) {
sys.append.on("click", function() {
sys.list.append("Item");
});
sys.remove.on("click", function() {
sys.list.first() && sys.list.first().remove();
});
sys.modify.on("click", function() {
sys.list.first() && items.list.first().data = {color: "blue", shape: "rectangle"};
});
}
}
Item: {
xml: "<li class='ui-state-default'><span class='ui-icon ui-icon-arrowthick-2-n-s'/><span id='data'/></li>",
map: { appendTo: "data" },
fun: function (sys, items, opts) {
return { data: sys.data.text };
}
}
List: {
css: "#list{ list-style-type: none; margin: 0; padding: 0; width: 60%; }\
#list li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }\
#list li span { position: absolute; margin-left: -1.3em; }",
xml: "<ul id='list'/>",
fun: function (sys, items, opts) {
var elem = this.elem();
$(elem).sortable();
$(elem).disableSelection();
}
}
Example: {
xml: "<List id='example'>\
<Item>Item 1</Item>\
<Item>Item 2</Item>\
<Item>Item 3</Item>\
</List>"
}
List: {
xml: "<ul id='list'/>",
fun: function (sys, items, opts) {
function setValue(array) {
var list = sys.list.children();
for ( var i = 0; i < array.length; i++ )
(list[i] || sys.list.append("Item")).show().text(array[i]);
for ( var k = i; k < list.length; k++ )
list[k].hide();
}
return Object.defineProperty({}, "value", { set: setValue });
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有