List 插件支持用户选择一项或者多项数据。在上一篇文章中我们,给大家介绍了 Wijmo -分割器插件的特性及使用方法。感谢园子中朋友的支持,朋友们的支持给我们写这一系列文章提供了很大的动力。在这篇文章中我们将介绍 List 的特性及使用方法。 List 即为 jQuery 中的列表插件。
如果你是第一次看本系列文章,那么还可以参考本系列的其他几篇文章,相信会给你带来更多惊喜:
首先让我们看看 Wijmo List 给我们带来了哪些惊喜?
ComponentOne为ASP.NET Wijmo 出品的 List 插件支持用户选择一项或者多项数据。
HTML 标签:
<div id=
"list"
>
</div>
jQuery 脚本:
<script type=
"text/javascript"
>
$(document).ready(
function
() {
$(
"#list"
).wijlist({
});
var
testArray = [{
label:
'c++'
,
value:
'c++'
}, {
label:
'java'
,
value:
'java'
}, {
label:
'coldfusion'
,
value:
'coldfusion'
}, {
label:
'javascript'
,
value:
'javascript'
}];
var
list = $(
"#list"
);
//Pass the array list to the wijlist widget
list.wijlist(
'setItems'
, testArray);
//Render the list in the client browser
list.wijlist(
'renderList'
);
});
</script>
List 插件允许用户进行单项选择。
List 插件允许用户进行多项选择。
你可以使用这一种级联样式表(CSS)的样式来定义自定义皮肤。有了CSS支持,你可以使该扩展器与你的组织标准相匹配。
1.源码下载(包含以上特性):Wijmo-List.zip
2.更多信息请参考:Wijmo 中文网站:http://www.gcpowertools.com.cn/products/c1_asp_overview.htm
3.开源Wijmo jQuery 讨论社区: http://gcdn.grapecity.com/index.aspx
$(
"#element"
).wijlist(
"option"
,
"addHoverItemClass"
,
false
);
$(
"#element"
).wijlist(
"option"
,
"autoSize"
,
true
);
$(
"#element"
).wijlist(
"option"
,
"disabled"
,
true
);
$(
"#element"
).wijlist(
"option"
,
"keepHightlightOnMouseLeave"
,
true
);
$(
"#element"
).wijlist(
"option"
,
"maxItemsCount"
,6);
$(
"#element"
).wijlist(
"option"
,
"selectionMode"
,
'single’'
);
$(
"#element"
).wijlist(
"option"
,
"superPanelOptions"
,{…});
// Supply a callback function to handle the blur event:
$(
"#element"
).wijlist({ blur:
function
(e, item) { } });
// Bind to the event by type:
$(
"#element"
).bind(
"wijlistblur"
,
function
(e, item) { });
// Supply a callback function to handle the focus event:
$(
"#element"
).wijlist({ focus:
function
(e, item) { } });
// Bind to the event by type:
$(
"#element"
).bind(
"wijlistfocus"
,
function
(e, item) { });
// Supply a callback function to handle the focusing event:
$(
"#element"
).wijlist({ focusing:
function
(e, item) { } });
// Bind to the event by type:
$(
"#element"
).bind(
"wijlistfocusing"
,
function
(e, item) { });
// Supply a callback function to handle the itemRendered event:
$(
"#element"
).wijlist({ itemRendered:
function
(e, item) { } });
// Bind to the event by type:
$(
"#element"
).bind(
"wijlistitemRendered"
,
function
(e, item) { });
// Supply a callback function to handle the itemRendering event:
$(
"#element"
).wijlist({ itemRendering:
function
(e, item) { } });
// Bind to the event by type:
$(
"#element"
).bind(
"wijlistitemRendering"
,
function
(e, item) { });
// Supply a callback function to handle the listRendered event:
$(
"#element"
).wijlist({ listRendered:
function
(e, list) { } });
// Bind to the event by type:
$(
"#element"
).bind(
"wijlistlistRendered"
,
function
(e, list) { });
// Supply a callback function to handle the selected event:
$(
"#element"
).wijlist({ selected:
function
(e, data) { } });
// Bind to the event by type:
$(
"#element"
).bind(
"wijlistselected"
,
function
(e, data) { });
$(
"#element"
).wijlist(
"activate"
,
null
, {label:
"label1"
, value:
"value1"
},
false
);
$(
"#element"
).wijlist(
"addItem"
, {label:
"label1"
, value:
"value1"
});
$(
"#element"
).wijlist(
"deactivate"
);
$(
"#element"
).wijlist(
"destroy"
);
$(
"#element"
).wijlist(
"first"
);last
$(
"#element"
).wijlist(
"getItems"
,5);
$(
"#element"
).wijlist(
"getList"
);
$(
"#element"
).wijlist(
"indexOf"
, {label:
"label1"
, value:
"value1"
});setItems(items)
$(
"#element"
).wijlist(
"last"
);
$(
"#element"
).wijlist(
"next"
);nextPage
$(
"#element"
).wijlist(
"nextPage"
);
$(
"#element"
).wijlist(
"popItem"
);
$(
"#element"
).wijlist(
"previous"
);previousPage
$(
"#element"
).wijlist(
"previousPage"
);
$(
"#element"
).wijlist(
"refreshSuperPanel"
);
$(
"#element"
).wijlist(
"removeAll"
);
$(
"#element"
).wijlist(
"removeItem"
, {label:
"label1"
, value:
"value1"
});
$(
"#element"
).wijlist(
"removeItemAt"
, 3);
$(
"#element"
).wijlist(
"renderList"
);
$(
"#element"
).wijlist(
"selectItems"
,5,
false
);
$(
"#element"
).wijlist(
"setItems"
,{label:
"label1"
, value:
"value1"
});
$(
"#element"
).wijlist(
"unselectItems"
,5);