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
chenhao
hel-developer-guide
Commits
b5ca9079
Commit
b5ca9079
authored
Jul 31, 2017
by
Jefferyne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates 前端组件/NumericTextBox.md
Auto commit by GitBook Editor
parent
f18c9b8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
20 deletions
+35
-20
NumericTextBox.md
前端组件/NumericTextBox.md
+35
-20
No files found.
前端组件/NumericTextBox.md
View file @
b5ca9079
...
...
@@ -163,7 +163,9 @@ $("#numerictextbox").kendoNumericTextBox({
</script>
```
##### 10.[bind](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-value) 及默认值的设置
### 方法:
##### 1.[bind](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-value) 及默认值的设置
说明:设置默认值
...
...
@@ -177,8 +179,6 @@ var viewModel = kendo.observable({
},
});
</script>
//设置是否编辑
<h:hlsNumericTextBox
id=
"sumDueAmount"
bind=
"enabled: enabled"
style=
"width:100%"
/>
//设置默认值
<h:hlsNumericTextBox
id=
"sumDueAmount"
bind=
"enabled: enabled, value:data.sumDueAmount"
style=
"width:100%"
/>
//设置文本框前面的名称
...
...
@@ -189,25 +189,26 @@ var viewModel = kendo.observable({
<h:hlsNumericTextBox
id=
"sumDueAmount"
bind=
"enabled: enabled, value:data.sumDueAmount"
colspan=
"3"
prompt=
"注册资本"
promptColspan=
"1"
style=
"width:100%"
/>
```
### 方法:
##### 1.[enable](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-enable)
##### 2.[enable](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-enable)
说明:是否启用编辑
```
html
<h:hlsNumericTextBox
id=
"numerictextbox"
bind=
"enabled: enabled"
/>
//js实现
//定义数据模型
<script>
$
(
"#numerictextbox"
).
kendoNumericTextBox
();
var
numerictextbox
=
$
(
"#numerictextbox"
).
data
(
"kendoNumericTextBox"
);
numerictextbox
.
enable
(
false
);
var
viewModel
=
kendo
.
observable
({
enabled
:
false
,
//或者true
data
:
{
},
});
</script>
//设置是否编辑
<h:hlsNumericTextBox
id=
"sumDueAmount"
bind=
"enabled: enabled"
style=
"width:100%"
/>
```
![](
/assets/193025.png
)
#####
2
.[readonly](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-readonly)
#####
3
.[readonly](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-readonly)
说明:是否启用只读
...
...
@@ -222,7 +223,7 @@ numerictextbox.readonly();
![](
/assets/93141.png
)
#####
3
.[focus](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-focus)
#####
4
.[focus](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-focus)
说明:聚焦
...
...
@@ -235,20 +236,25 @@ numerictextbox.focus();
</script>
```
#####
4
.[value](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-value)
#####
5
.[value](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-value)
说明:获取和设置值
```
html
<h:hlsNumericTextBox
id=
"numerictextbox"
/>
<script>
$
(
"#numerictextbox"
).
kendoNumericTextBox
();
var
numerictextbox
=
$
(
"#numerictextbox"
).
data
(
"kendoNumericTextBox"
);
var
viewModel
=
kendo
.
observable
({
enabled
:
false
,
//或者true
data
:
{
sumDueAmount
:
10000
},
});
</script>
<h:hlsNumericTextBox
id=
"sumDueAmount"
bind=
"enabled: enabled, value:data.sumDueAmount"
colspan=
"3"
prompt=
"注册资本"
promptColspan=
"1"
style=
"width:100%"
/>
<script>
//获取值
var
value
=
numerictextbox
.
value
();
//设置值
numerictextbox
.
value
(
0.5
);
var
value
=
viewModel
.
data
.
sumDueAmount
</script>
```
### 事件:
...
...
@@ -271,6 +277,15 @@ numerictextbox.bind("change", function() {
var
value
=
this
.
value
();
});
</script>
//方法三
<h:hlsNumericTextBox
id=
"numerictextbox"
bind=
"enabled: enabled, value:data.numerictextbox"
change=
"change"
style=
"width:100%"
/>
<script>
function
change
(){
alert
(
"改变事件"
)
}
</script>
```
...
...
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