参数名 | 类型 | 描述 | 默认值 |
resize | Bool | 是否调整大小 | false |
isMultiSelect | Bool | 是否多选 | false |
isShowCheckBox | Bool | 是否显示复选框 | false |
columns | Array | 表格参数 | null |
selectBoxWidth | Int | 下拉框宽度 | null |
selectBoxHeight | Int | 下拉框高度 | null |
initValue | String | 初始化值 | null |
initText | String | 初始化文本 | null |
valueField | String | 值字段名 | 'id' |
textField | String | 文本字段名 | 'text' |
valueFieldID | String | 隐藏域元素的ID | null |
slide | Bool | 是否以动画的形式显示 | true |
split | String | 分隔符 | ; |
data | Object | 数据源 | null |
tree | Object | 同树参数 | null |
treeLeafOnly | Bool | 只对树叶节点有效 | true |
grid | Object | 同表格参数 | null |
hideOnLoseFocus | Bool | 失去焦点时隐藏 | true |
url | String | 数据源URL(需返回JSON) | null |
render | Object | 文本框渲染函数 | null |
absolute | Bool | 选择框是否在附加到body,并绝对定位 | true |
condition | Object | 条件同表单参数 | null |
cancelable | Bool | 是否取消选择 | false |
css | String | 附加className | null |
parms | Object | 异步数据请求参数 | null |
renderItem | Function | 项自定义html函数 | null |
autocomplete | Bool | 自动完成 | false |
readonly | Bool | 是否只读 | false |
ajaxType | String | ajax Type | 'post' |
valueFieldCssClass | String | 隐藏域css | NULL |
hideGridOnLoseFocus | Bool | 失去焦点(表格)时隐藏 | false |
alwayShowInTop | Bool | 下拉框总是显示在上方 | false |
1 var dataGrid = [ 2 { id: 1, name: '李三', sex: '男' }, 3 { id: 2, name: '李四', sex: '女' }, 4 { id: 3, name: '赵武', sex: '女' }, 5 { id: 4, name: '陈留', sex: '女' } 6 ]; 7 $("#txtGrid").ligerComboBox({ 8 data: dataGrid, 9 textField: 'name', 10 columns: [ 11 { header: 'ID', name: 'id', width: 20 }, 12 { header: '名字', name: 'name' }, 13 { header: '性别', name: 'sex' } 14 ], 15 selectBoxWidth: 200 16 });
1 $("#txt3").ligerComboBox({ 2 width: 180, 3 selectBoxWidth: 200, 4 selectBoxHeight: 200, valueField: 'text', 5 tree: { url: '../tree/tree.json' } 6 });
1 $("#txt1").ligerComboBox({ 2 width: 250, slide: false, 3 selectBoxWidth: 500, selectBoxHeight: 240, 4 valueField: 'CustomerID', textField: 'CustomerID', 5 grid: { 6 columns: [ 7 { display: '顾客', name: 'CustomerID', align: 'left', width: 100, minWidth: 60 }, 8 { display: '电话', name: 'Phone', width: 100 }, 9 { display: '城市', name: 'City', width: 100 }, 10 { display: '国家', name: 'Country', width: 100 } 11 ], switchPageSizeApplyComboBox: false, 12 data: $.extend({}, CustomersData), 13 pageSize: 30, 14 checkbox: true 15 } 16 });
1 $("#txt1").ligerComboBox({ 2 width: 250, 3 slide: false, 4 selectBoxWidth: 500, 5 selectBoxHeight: 240, 6 valueField: 'CustomerID', 7 textField: 'CustomerID', 8 grid: getGridOptions(true), 9 condition: { fields: [{ name: 'CompanyName', label: '客户', width: 90 }] } 10 });