Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hel-developer-guide
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Spencer Chang
hel-developer-guide
Commits
1b973873
Commit
1b973873
authored
Aug 02, 2017
by
custom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates 前端组件/hlsCombobox.md
Auto commit by GitBook Editor
parent
c12492e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
111 additions
and
139 deletions
+111
-139
hlsCombobox.md
前端组件/hlsCombobox.md
+111
-139
No files found.
前端组件/hlsCombobox.md
View file @
1b973873
# hlsCombobox标签
# hlsCombobox标签(下拉框)
ComboBox下拉列表组件,通常数据源以code - meaning形式出现,用户操作的是meaning,实际保存的是code。
ComboBox下拉列表组件,通常数据源以code - meaning形式出现,用户操作的是meaning,实际保存的是code。
```
xml
```
xml
<h:hlsCombobox
name=
"hlsCombobox"
id=
"hlsCombobox"
<h:hlsCombobox
name=
"hlsCombobox"
id=
"hlsCombobox"
bind=
"enabled: isEnabled,source: sdDataSource, value:data.code"
bind=
"enabled: isEnabled,source: sdDataSource, value:data.code"
colspan=
"3"
colspan=
"3"
dataTextField=
"meaning"
dataTextField=
"meaning"
dataValueField=
"code"
dataValueField=
"code"
placeholder=
"hlsCombobox"
placeholder=
"hlsCombobox"
prompt=
"hlsCombobox"
prompt=
"hlsCombobox"
promptColspan=
"1"
promptColspan=
"1"
valuePrimitive=
"true"
valuePrimitive=
"true"
style=
"width:100%"
style=
"width:100%"
/>
/>
```
```
### **主要属性**
### **主要属性**
属性名 | 类型
属性名 | 类型 | 说明 |
-------- | ---
--- | --- | --- |
id | String
id | String | id |
promptColspan | String
promptColspan | String | 提示语句需要占几列 |
promptClassName | String
promptClassName | String | 提示语句类名,默认不填 |
promptImage | String
promptImage | String | 提示前面的文字图形,默认不填 |
prompt | String
prompt | String | 提示信息 |
colspan | String
colspan | String | 所占列数 |
hlsClassName | String
hlsClassName | String | 类名,默认不填 |
animation | Boolean
dataSource | DataSource | 数据源 |
autoBind | Boolean
dataTextField | String | 返回的显示描述字段 |
autoWidth | Boolean
dataValueField| String | 绑定的英文字段 |
cascadeFrom| String
enable | Boolean | 是否可编辑,true为可编辑,false不可编辑 |
cascadeFromField | String
placeholder | String | 占位符 |
clearButton| Boolean
template| Function| 渲染函数 |
dataSource | DataSource
change| Function | 数据变化时触发的函数 |
dataTextField | String
dataValueField| String
delay | Number
> 属性用法请参考KendoUI文档 [http://docs.telerik.com/kendo-ui/api/javascript/ui/combobox](http://docs.telerik.com/kendo-ui/api/javascript/ui/combobox)
enable | Boolean
enforceMinLength| Boolean
filter | String
### **用法示例*
fixedGroupTemplate| String
\|
Function
footerTemplate| String
\|
Function
```
javascript
groupTemplate| String
\|
Function
height| Number
highlightFirst| Boolean
ignoreCase| Boolean
//对于系统定义好的数据源
index| Number
<
script
src
=
"${base.contextPath}/common/code?sdDataSource=FND.CODING_RULE_TYPE"
type
=
"text/javascript"
><
/script
>
minLength| Number
noDataTemplate| String
\|
Function
placeholder | String
//自定义静态数据源sdDataSource
suggest| Boolean
var
sdDataSource
=
new
kendo
.
data
.
DataSource
({
headerTemplate| String
\|
Function
data
:[
"one"
,
"two"
]
template| String
\|
Function
});
text| String
value| String
//自定义动态查询到的数据源sdDataSource
valuePrimitive| Boolean
$
.
ajax
({
virtual| Boolean
type
:
'GET'
,
change| Function
url
:
url
,
close| Function
async
:
false
,
dataBound | Function
contentType
:
"application/json; charset=utf-8"
,
filtering| Function
success
:
function
(
datas
)
{
open| Function
viewModel
.
set
(
"sdDataSource,"
,
datas
.
rows
);
select| Function
}
cascade| Function
});
> 属性用法请参考KendoUI文档 [http://docs.telerik.com/kendo-ui/api/javascript/ui/combobox](http://docs.telerik.com/kendo-ui/api/javascript/ui/combobox)
//需要注意,bind中写dataSource,需要在viewModel中定义
var
viewModel
=
kendo
.
observable
({
### **用法示例*
enabled
:
true
,
isEnabled
:
false
,
```
javascript
data
:
{},
sdDataSource
:
sdDataSource
,
});
//对于系统定义好的数据源
//下拉列表渲染函数
<
script
src
=
"${base.contextPath}/common/code?sdDataSource=FND.CODING_RULE_TYPE"
type
=
"text/javascript"
><
/script>
var
itemTemplate
=
function
(){
//...
}
//自定义静态数据源sdDataSource
var
sdDataSource
=
new
kendo
.
data
.
DataSource
({
//选中某一个列表选项后触发
data
:[
"one"
,
"two"
]
function
onComboboxChange
(
e
){
});
var
value
=
this
.
value
();
// Use the value of the widget.
//自定义动态查询到的数据源sdDataSource
}
$
.
ajax
({
//以上两种函数定义方法皆可
type
:
'GET'
,
```
url
:
url
,
async
:
false
,
```
xml
contentType
:
"application/json; charset=utf-8"
,
<h:hlsCombobox
name=
"hlsCombobox"
id=
"hlsCombobox"
success
:
function
(
datas
)
{
bind=
"enabled: isEnabled,source: sdDataSource, value:data.code"
viewModel
.
set
(
"sdDataSource,"
,
datas
.
rows
);
colspan=
"3"
}
dataTextField=
"meaning"
});
dataValueField=
"code"
placeholder=
"hlsCombobox"
//需要注意,bind中写dataSource,需要在viewModel中定义
prompt=
"hlsCombobox"
var
viewModel
=
kendo
.
observable
({
promptColspan=
"1"
enabled
:
true
,
valuePrimitive=
"true"
isEnabled
:
false
,
style=
"width:100
data
:
{},
change="
onComboboxChange"
sdDataSource
:
sdDataSource
,
template=
"fn:itemTemplate"
});
/>
//下拉列表渲染函数
```
var
itemTemplate
=
function
(){
#### 特别注意 valuePrimitive="true" 如果该值为false,选中的值将不会匹配给dataTextField和dataValueField
//...
dataValueField
}
> **提示:** 某些属性类型为**String \| Function** 时,表明它可以定义为字符串或者函数。因此当需要定义为Function时需要增加前缀**fn:**来区分(例如函数template="fn:itemTemplate" )
//选中某一个列表选项后触发
function
onComboboxChange
(
e
){
var
value
=
this
.
value
();
// Use the value of the widget.
}
//以上两种函数定义方法皆可
```
```
xml
<h:hlsCombobox
name=
"hlsCombobox"
id=
"hlsCombobox"
bind=
"enabled: isEnabled,source: sdDataSource, value:data.code"
colspan=
"3"
dataTextField=
"meaning"
dataValueField=
"code"
placeholder=
"hlsCombobox"
prompt=
"hlsCombobox"
promptColspan=
"1"
valuePrimitive=
"true"
style=
"width:100
change="
onComboboxChange"
template=
"fn:itemTemplate"
/>
```
#### 特别注意 valuePrimitive="true" 如果该值为false,选中的值将不会匹配给dataTextField和dataValueField
dataValueField
> **提示:** 某些属性类型为**String \| Function** 时,表明它可以定义为字符串或者函数。因此当需要定义为Function时需要增加前缀**fn:**来区分(例如函数template="fn:itemTemplate" )
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment