Commit 35df4bad authored by Jefferyne's avatar Jefferyne

Conflict resolution

parents 923c3774 f0be650a
# dataSource标签
数据源组件
```xml
<h:dataSource id="gridDataSource" batch="true" pageSize="10" serverPaging="true" error="requestError">
<h:transport parameterMap="parameterMap">
<h:read url="${base.contextPath}/sys/resource/query" type="POST" dataType="json"/>
<h:create url="${base.contextPath}/sys/resource/submit" type="POST" contentType="application/json"/>
<h:update url="${base.contextPath}/sys/resource/submit" type="POST" contentType="application/json"/>
<h:destroy url="${base.contextPath}/sys/resource/remove" type="POST" contentType="application/json"/>
</h:transport>
<h:schema data="rows" total="total" errors="schemaError">
<h:model id="resourceId" editable="dsEditable">
<h:fields>
<h:item name="loginRequire" defaultValue="Y" type="boolean" checkedValue="Y" uncheckedValue="N"/>
<h:item name="accessCheck" defaultValue="Y" type="boolean" checkedValue="Y" uncheckedValue="N"/>
<h:item name="type" defaultValue=""/>
<h:item name="url">
<h:validation required="true"/>
</h:item>
<h:item name="name">
<h:validation required="true"/>
</h:item>
</h:fields>
</h:model>
</h:schema>
</h:dataSource>
```
### **主要属性**
| 属性名 | 类型 |
| --- | --- |
| data | Array & String |
| autoSync | Boolean |
| batch | Boolean |
| page | Integer |
| pageSize | Integer |
| serverAggregates | Boolean |
| serverFiltering | Boolean |
| serverGrouping | Boolean |
| serverPaging | Boolean |
| serverSorting | Boolean |
| type | String |
| change | Function |
| error | Function |
| push | Function |
| requestEnd | Function |
| requestStart | Function |
| sync | Function |
> **提示:** 属性用法请参考kendoui API文档 [http://docs.telerik.com/kendo-ui/api/javascript/data/datasource](http://docs.telerik.com/kendo-ui/api/javascript/data/datasource)
### **主要子节点**
* transport
* schema
* sort
### **transport**
服务端交互配置
#### **transport属性**
| 属性名 | 类型 |
| --- | --- |
| parameterMap | Function |
| push | Function |
```xml
<h:dataSource id="gridDataSource" >
<h:transport parameterMap="parameterMap">
...
</h:transport>
</h:dataSource>
```
#### **transport子节点**
主要有以下几种节点类型
* read
* create
* update
* destroy
| 属性名 | 类型 |
| --- | --- |
| cache | Boolean |
| contentType | String |
| data | Object \| Function |
| dataType | String |
| type | String |
| url | String \| Function |
```xml
<h:transport parameterMap="parameterMap">
<h:read url="${base.contextPath}/sys/resource/query" type="POST" dataType="json"/>
<h:create url="${base.contextPath}/sys/resource/submit" type="POST" contentType="application/json"/>
<h:update url="${base.contextPath}/sys/resource/submit" type="POST" contentType="application/json"/>
<h:destroy url="${base.contextPath}/sys/resource/remove" type="POST" contentType="application/json"/>
</h:transport>
```
### **schema**
定义datasource的数据结构
#### **schema属性**
| 属性名 | 类型 |
| --- | --- |
| data | String \| Function |
| errors | String \| Function |
| groups | String \| Function |
| parse | Function |
| total | String \| Function |
| type | String |
```xml
<h:dataSource id="gridDataSource" >
<h:schema data="rows" total="total" errors="schemaError">
...
</h:schema>
</h:dataSource>
```
#### **schema子节点**
* model
| 属性名 | 类型 |
| --- | --- |
| id | String |
| editable | Function |
```xml
<h:schema data="rows" total="total" errors="schemaError">
<h:model id="resourceId" editable="dsEditable">
<h:fields>
...
</h:fields>
</h:model>
</h:schema>
```
#### **model子节点**
* field
| 属性名 | 类型 |
| --- | --- |
| name | String |
| defaultValue | Object |
| editable | Boolean |
| nullable | Boolean |
| parse | Function |
| type | String |
| from | String |
| checkedValue | String |
| uncheckedValue | String |
```xml
<h:schema data="rows" total="total" errors="schemaError">
<h:model id="resourceId" editable="dsEditable">
<h:fields>
<h:item name="loginRequire" defaultValue="Y" type="boolean" checkedValue="Y" uncheckedValue="N"/>
<h:item name="accessCheck" defaultValue="Y" type="boolean" checkedValue="Y" uncheckedValue="N"/>
<h:item name="type" defaultValue=""/>
<h:item name="url">
<h:validation required="true"/>
</h:item>
<h:item name="name">
<h:validation required="true"/>
</h:item>
</h:fields>
</h:model>
</h:schema>
```
#### **field子节点**
* validation
| 属性名 | 类型 |
| --- | --- |
| required | Boolean |
| max | Integer |
| min | Integer |
### **sort**
| 属性名 | 类型 |
| --- | --- |
| dir | String |
| field | String |
| compare | function |
```xml
<h:dataSource id="gridDataSource" batch="true" pageSize="10" serverPaging="true" serverSorting="true" error="requestError">
<h:transport parameterMap="parameterMap">
...
</h:transport>
<h:schema data="rows" total="total" errors="schemaError">
<h:model id="resourceId" editable="dsEditable">
<h:fields>
...
</h:fields>
</h:model>
</h:schema>
<h:sort>
<h:item field="url" dir="desc"/>
</h:sort>
</h:dataSource>
```
## Grid
#### 表格
对于API文档中的所有属性,考虑实际需要,有些属性没必要实现,本文档若未列出,就代表并未实现
#### xml配置
```xml
<!--h:为命名空间,必须要加的,grid为组件名;id可写可不写-->
<h:grid id="grid"/>
```
```xml
<!--grid-->
<h:grid dataSource="dataSource" selectable="multiple, rowbox" editable="true">
<h:pageable pageSizes="5, 10, 20, 50" buttonCount="5" refresh="true">
</h:pageable>
<h:columns>
<h:column field="moduleCode" title='' width="100"/>
<h:column field="functionCode" title='' width="180"/>
</h:columns>
</h:grid>
```
---
对于所有属性,无论是直接属性,还是子标签的属性,都遵循以下原则:
1.若是简单的属性,就添加到当前标签上,若是对象,就创建子标签,这里的简单属性是指能直接被描述在当前标签上的属性,如字符串,函数,\(函数只是一个引用\),布尔类型,数字类型等等,对象是指这个属性又包含了子属性,所以我们不得不向下创建子标签才能将其子属性描述出来。
2.对于String和Function类型,必须用fn:前缀加以区分,
3.对于数组,有些数组是字符串数组,这种直接当作简单的属性处理,用逗号分隔每个字符串即可,有些数组是list集合数组,这种必须先创建属性子标签,再创建item子标签来描述集合,详情可参考子标签columns
---
### **一般属性 **
> **提示:**
>
> * 属性用法请参考kendoui API文档的grid: [http:\/\/docs.telerik.com\/kendo-ui\/api\/javascript\/ui\/gird](http://docs.telerik.com/kendo-ui/api/javascript/ui/gird)
| 属性名 | 类型 |
| :--- | :--- |
| allowCopy | Boolean |
| altRowTemplate | String & Function |
| autoBind | Boolean |
| columnResizeHandleWidth | Integer |
| columnMenu | Boolean |
| dataSource | kendo.data.DataSource\(Function\) |
| detailTemplate | String & Function |
| editable | Boolean & String |
| groupable | Boolean |
| height | Integer & String |
| mobile | Boolean & String |
| navigatable | Boolean |
| noRecords | Boolean |
| pageable | Boolean |
| reorderable | Boolean |
| resizable | Boolean |
| rowTemplate | String & Function |
| scrollable | Boolean |
| selectable | Boolean & String |
| sortable | Boolean |
| toolbar | String & Function |
| cancel | Function |
| change | Function |
| columnHide | Function |
| columnMenuInit | Function |
| columnReorder | Function |
| columnResize | Function |
| columnShow | Function |
| dataBinding | Function |
| dataBound | Function |
| detailCollapse | Function |
| detailExpand | Function |
| detailInit | Function |
| edit | Function |
| excelExport | Function |
| filter | Function |
| group | Function |
| page | Function |
| pdfExport | Function |
| filterMenuInit | Function |
| remove | Function |
| save | Function |
| saveChanges | Function |
| sort | Function |
| columnLock | Function |
| columnUnlock | Function |
| navigate | Function |
用法示例:
```javascript
//注意这是写在script标签里的内容
var dataSource = new kendo.data.DataSource({
data: [
{ name: "Jane Doe", age: 30 },
{ name: "John Doe", age: 33 }
]
});
function edit(){
//...
}
function rowTemplate(){
//...
}
```
```xml
<h:grid id="grid" dataSource="dataSource" resizable= "true" height= "100%" edit ="edit" rowTemplate="fn:rowTemplate"/>
```
> **提示:**
>
> * 上述所有属性直接添加在标签内即可,(**\[\*\***属性名\]**\*\* = "..."**),对于类型是函数的属性,需要另外在script标签中具体定义函数,这里只是一个引用,对于类型**既是函数又是字符串**类型的属性,一定要加**fn:** 来区分,加fn:的代表这是一个函数,对于**既是字符串又是布尔类型**的属性,照常输入就行了。
#### **子标签**
| 属性名 | 类型 |
| --- | --- |
| allowCopy | Object |
| columns | Array |
| columnMenu | Object |
| editable | Object |
| messages | Object |
| scrollable | Object |
| sortable | Object |
| toolbar | Array |
#### **allowCopy**子标签
| 属性 | 类型 |
| --- | --- |
| delimeter | String & Object |
```xml
<!--delimeter是Object类型-->
<h:grid>
<h:allowCopy>
<h:delimeter />
</h:allowCopy>
</h:grid>
<!--delimeter是String类型-->
<h:grid>
<h:allowCopy delimeter=",">
</h:allowCopy>
</h:grid>
```
#### **columns**子标签
| 属性 | 类型 |
| --- | --- |
| attributes | Object |
| command | Object |
| editor | Function |
| encoded | Boolean |
| expandable | Boolean |
| field | String |
| footerTemplate | String & Function |
| format | String |
| headerAttributes | Object |
| headerTemplate | String & Function |
| minScreenWidth | Integer |
| sortable | Object |
| template | String & Function |
| title | String |
| width | Integer & String |
| hidden | Boolean |
| menu | Boolean |
| locked | Boolean |
| lockable | Boolean |
| aggregates | Array |
| columns | Object |
| filterable | Object |
| groupable | Boolean |
| groupHeaderTemplate | String & Function |
| groupFooterTemplate | String & Function |
| values | Array |
| footerAttributes | Object |
#### **columns-filterable**子标签
| 属性 | 类型 |
| --- | --- |
| cell | Object |
| multi | Boolean |
| dataSource | Function |
| checkAll | Boolean |
| itemTemplate | Function |
| operators | Object |
| search | Boolean |
| ignoreCase | Boolean |
| ui | Object |
**attributes**用法:
```xml
<h:grid>
<h:columns>
<h:column>
<h:attributes "style"="text-align:center"/>
</h:column>
</h:columns>
</h:grid>
```
**command**用法:
```xml
<!--对于数组来说,有两种形式,一种是直接用逗号分隔,放在标签上的,如 aggregates;另一种是创建子标签,再创建item子标签,再将数组内的内容整合到item子标签上,如command,先创建command子标签,再创建item子标签,再将数组中的每一个集合放在item标签上-->
<h:grid>
<h:columns aggregates="count,min,max">
<h:column template="fn:template"/>
<h:column field="functionId" width="30px/>
<h:column title="列头" locked="true">
<h:command>
<h:item name="edit"></h:item>
<h:item name="destroy"></h:item>
</h:command>
</h:column>
</h:columns>
</h:grid>
```
**editor**用法:
```javascript
function editor(){
//...
}
```
```xml
<h:grid>
<h:columns>
<h:column editor="editor">
</h:column>
</h:coulmns>
</h:grid>
```
**filterable**用法:
```xml
<!--以filterable举例 遇到对象就向下添加子标签-->
<h:grid>
<h:columns>
<h:column>
<h:filterable>
<h:cell dataTextField="name"/>
</h:filterable>
</h:column>
</h:columns>
</h:grid>
```
**headerAtrributes**用法:
```xml
<h:grid>
<h:columns>
<h:column>
<h:headerAttributes "style"="color:red">
</h:column>
</h:columns>
</h:grid>
```
#### **ColumnMenu**子标签
| 属性 | 类型 |
| --- | --- |
| columns | Boolean |
| filterable | Boolean |
| sortable | Boolean |
| messages | Object |
用法:
```xml
<h:grid id="grid">
<h:columnMenu columns="true" fileterable="false">
<h:messages columns="choose columns"/>
</h:columnMenu>
</h:grid >
```
#### **editable**子标签
| 属性 | 类型 |
| --- | --- |
| confirmation | Object |
| cancelDelete | String |
| confirmDelete | String |
| createAt | String |
| destroy | Boolean |
| mode | String |
| template | String & Function |
| update | Boolean |
用法:
```xml
<h:grid id="grid">
<h:columnMenu columns="true" fileterable="false">
<h:messages columns="choose columns"/>
</h:columnMenu>
</h:grid >
```
#### **pageable**子标签
| 属性 | 类型 |
| --- | --- |
| pageSize | Integer |
| previousNext | Boolean |
| numeric | Boolean |
| buttonCount | Integer |
| input | Boolean |
| pageSizes | Boolean & Array |
| refresh | Boolean |
| info | Boolean |
| messages | Object |
用法:
```xml
<!--pageSizes 为array时-->
<h:grid>
<h:pageable pageSizes="all,5,10,20,50" buttonCount="5" refresh="true">
<h:messages display="show"/>
</h:pageable>
</h:grid>
```
#### **messages**子标签
| 属性 | 类型 |
| --- | --- |
| commands | Object |
| noRecords | String |
用法:
```xml
<h:grid>
<h:messages noRecords="no data">
<h:commands cancel="cancel"/>
</h:messages >
</h:grid>
```
#### **noRecords**子标签
| 属性 | 类型 |
| --- | --- |
| template | String & Function |
用法:
```xml
<h:grid>
<h:noRecords template="no records">
</h:noRecords>
</h:grid>
```
#### **scrollable**子标签
| 属性 | 类型 |
| --- | --- |
| virtual | Boolean |
用法:
```xml
<h:grid>
<h:scrollable virtual="true"/>
</h:grid>
```
#### **sortable**子标签
| 属性 | 类型 |
| --- | --- |
| allowUnsort | Boolean |
| mode | String |
用法:
```xml
<h:grid>
<h:sortable allowUnsort="true" mode="multiple"/>
</h:grid>
```
#### **toolbar**子标签
| 属性 | 类型 |
| --- | --- |
| name | String |
| template | String & Function |
| text | String |
```javascript
function template(){
//...
}
```
```xml
<!--toolbar是数组 所以属性都是针对于数组内的集合来说的-->
<h:grid>
<h:toolbar>
<h:item name="create">
<!--当template为String时,由于xml会对标签的封闭符号敏感,所以可以采取下面的方式-->
<h:template>
<![CDATA[<span class=" btn btn-primary k-grid-add">#=text#</span>]]>
</h:template>
</h:item>
</h:toolbar>
</h:grid>
```
> **提示**:
>
> * 遇到**object**类型 就向下添加子标签,当遇到普通类型时,就添加到当前的标签上,就像处理一般属性那样。
# HlsNavigationBar
左侧导航栏
说明:前期仅封装了一些常用的属性
### 一般属性:
| 属性 | 类型 |
| :--- | :--- |
| navigationBarTitle | String |
| navigationBar | String |
| navigationBarContent | String |
| treeTitle | String |
| navigationBarId | String |
| navigatonBarClass | String |
| barType | String |
| nodeLevel | String |
### 使用:
说明:目前系统遇到的是普通不分层的导航和分两层的导航,以下针对这两种使用说明
##### 1.hlsNavigationBar
说明:导航栏的标志标签,在这个标签内书写需要生成标签的内容
```html
<h:hlsNavigationBar>
<div></div>
<div></div>
<div></div>
<div></div>
</hlsNavigationBar>
```
##### 2.barType
说明:bartype有两种类型:tree(分层),normal(不分层)
```html
<h:hlsNavigationBar barType="tree">
<div></div>
</hlsNavigationBar>
```
##### 3.navigationBar
说明:加上此属性并设为“true”表示该块内容需要导航栏
```html
<h:hlsNavigationBar barType="tree">
<div navigationBar="true"></div>
</hlsNavigationBar>
```
##### 4.navigationBarTitle
说明:在导航栏中显示标题(如果是分层的导航栏这个就作为子标题显示),如果不写则取标签中title,若都为空则自动根据位置系统命名为"x.第x模块" x是数字
```html
<h:hlsNavigationBar barType="tree">
<div navigationBar="true" navigationBarTitle="标题1"></div>
</hlsNavigationBar>
```
##### 5.treeTitle
说明:作为分层导航栏的父标题,如果不写则取标签中的title,若都为空则系统自动命名为"x.第x模块" x是数字
```html
<h:hlsNavigationBar barType="tree">
<div nodeLevl="parent" navigationBar="true" treeTitle="承租人注册信息"></div>
<div navigationBar="true" navigationBarTitle="注册信息"></div>
</hlsNavigationBar>
```
##### 6.nodeLevel
说明:添加该属性并设置为“parent”则表示该标题作为父标题,不添加则为子标题
![](/assets/4108.png)
### 使用实例:
##### 1.分层实例
```html
<h:hlsNavigationBar barType="tree">
<div nodeLevl="parent" navigationBar="true" treeTitle="基本信息">
//这里是内容
</div>
<div navigationBar="true" navigationBarTitle="基本信息">
//这里是内容
</div>
<div nodeLevl="parent" navigationBar="true" treeTitle="承租人注册信息">
//这里是内容
</div>
<div navigationBar="true" navigationBarTitle="注册信息">
//这里是内容
</div>
<div navigationBar="true" navigationBarTitle="历史沿革">
//这里是内容
</div>
<div navigationBar="true" navigationBarTitle="股权结构">
//这里是内容
</div>
<<h:hlsForm navigationBar="true" navigationBarTitle="经营情况">
//这里是内容
</hlsForm>
<div navigationBar="true" navigationBarTitle="财务状况">
//这里是内容
</div>
<div nodeLevl="parent" navigationBar="true" treeTitle="租赁交易分析">
//这里是内容
</div>
<div navigationBar="true" navigationBarTitle="租赁报价方案">
//这里是内容
</div>
<h:dataSource></dataSource>
<h:hlsGridBox navigationBar="true" navigationBarTitle="租赁物信息"></hlsGridBox>
</hlsNavigationBar>
```
##### 效果图:![](/assets/import.png)2.不分层实例
```html
<h:hlsNavigationBar barType="tree">
<div navigationBar="true" navigationBarTitle="基本信息">
//这里是内容
</div>
<div navigationBar="true" navigationBarTitle="开票信息">
//这里是内容
</div>
<div navigationBar="true" navigationBarTitle="地址信息">
//这里是内容
</div>
<div navigationBar="true" navigationBarTitle="联系人信息">
//这里是内容
</div>
<<h:hlsForm navigationBar="true" navigationBarTitle="关联方信息">
//这里是内容
</hlsForm>
<h:dataSource></dataSource>
<h:hlsGridBox navigationBar="true" navigationBarTitle="银行账户信息"></hlsGridBox>
</hlsNavigationBar>
```
效果图:
![](/assets/215412.png)
## NumericTextBox
提示:以下配置,方法和事件均为个人了解到的,不代表组件的全部。
### 配置:
##### 1.[culture](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-culture)[`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)_\(default: "en-US"\)_
```html
<!--
TODO: Add the kendo.culture.de-DE.min.js file as it is required!
Here is a sample script tag:
<script src="http://kendo.cdn.telerik.com/{kendo version}/js/cultures/kendo.culture.de-DE.min.js">
</script>
For more information check this help topic:
http://docs.telerik.com/kendo-ui/framework/globalization/overview
-->
<input id="numerictextbox"/>
<script>
$("#numerictextbox").kendoNumericTextBox
({
culture:"de-DE"
});
</script>
```
##### 2.[decimals](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-decimals)[`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)_\(default: null\)_
说明:指定数量精度NumericTextBox时。 例如,如果小数是`2`和用户输入`12.346`,将成为价值`12.35`。 如果用户输入`12.99`,将成为价值`13.00`
```html
<input id="numerictextbox"/>
<script>
$("#numerictextbox").kendoNumericTextBox
({
decimals:2
});
</script>
```
##### 3.[downArrowText](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-downArrowText)[`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)_\(default: "Decrease value"\)_
```html
<input id="numerictextbox"/>
<script>
$("#numerictextbox").kendoNumericTextBox
({
downArrowText:"Less"
});
</script>
```
4.[factor](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-factor)[`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)_\(default: "1"\)_
说明:假设以数字15输入,并把NumberitextBox的属性设为0.01,则显示的结果为15%。
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
format: "p0",
factor: 100,
min: 0,
max: 1,
step: 0.01
});
</script>
```
输入前:![](/assets/2.png)输入后:![](/assets/3.png)
##### 5.[format](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-format)[`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)_\(default: "n"\)_
说明: 设置控件显示的格式,常用的有c(货币形式)、n(数值形式)和p(百分比形式),实例中的c3表示货币形式,精确到小数后三位。
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
format: "c3"
});
</script>
```
输入前:![](/assets/4.png)输入后:![](/assets/5.png)
##### 6.[max](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-max)[`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)_\(default: null\)_
说明:限制显示的最大数
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
max: 100
});
</script>
```
输入前:![](/assets/20170727140825.png)输入后:![](/assets/20170727140905.png)
##### 6.[placeholder](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-placeholder)[`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)_\(default: ""\)_
说明:设置文本框里面的默认值
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
placeholder: "Set A Value"
});
</script>
```
![](/assets/20170727190929.png)
##### 7.[restrictDecimals](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-restrictDecimals)[`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)_\(default: false\)_
说明:当点击文框,是否允许设置显示的最大小数长度
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
decimals: 3,
restrictDecimals: false
});
</script>
```
点击前:![](/assets/1500.png)点击中:![](/assets/91517.png)
##### 8.[spinners](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-spinners)[`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)_\(default: true\)_
说明:是否启用文本框右边的上下按钮
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
spinners: false
});
</script>
```
##### 9.[step](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-step)[`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)_\(default: 1\)_
说明:点击右边上下按钮增加或者减少的值
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
step: 0.1
});
</script>
```
##### 10.[value](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#configuration-value)[`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)_\(default: null\)_
说明:设置默认值
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox({
value: 10
});
</script>
```
### 方法:
##### 1.[enable](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-enable)
说明:是否启用编辑
```html
<input id="numerictextbox" disabled="disabled" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
numerictextbox.enable(false);
</script>
```
![](/assets/193025.png)
##### 2.[readonly](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-readonly)
说明:是否启用只读
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
numerictextbox.readonly();
</script>
```
![](/assets/93141.png)
##### 3.[focus](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-focus)
说明:聚焦
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
numerictextbox.focus();
</script>
```
##### 4.[value](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#methods-value)
说明:获取和设置值
```html
<input id="numerictextbox" />
<script>
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
//获取值
var value = numerictextbox.value();
//设置值
numerictextbox.value(0.5);
</script>
```
### 事件:
##### 1.[change](http://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox#events-change)
```html
<input id="numerictextbox" />
<script>
//方法一
$("#numerictextbox").kendoNumericTextBox({
change: function() {
var value = this.value();
}
});
//方法二
$("#numerictextbox").kendoNumericTextBox();
var numerictextbox = $("#numerictextbox").data("kendoNumericTextBox");
numerictextbox.bind("change", function() {
var value = this.value();
});
</script>
```
# HlsGridBox标签
说明:以下属性会举例一些常用的
### 一般属性:
| 属性名 | 类型 |
| :--- | :--- |
| HlsGridBox | String |
| title | String |
| width | String |
| height | String |
| hlsgridboxbody | String |
| hlsGridClass | String |
| hlsGridId | String |
| ContextPath | String |
| hlsBtnType | String |
| queryId | String |
| queryPlaceholder | String |
| ControllerName | String |
| viewModelName | String |
| dataSourceId | String |
| fildName | String |
| custom1Image | String |
| custom2Image | String |
| custom3Image | String |
| custom4Image | String |
| custom1Title | String |
| cuetom2Title | String |
| custom3Title | String |
| custom4Title | String |
### 字标签hlsGrid
说明:hlsGrid的子标签请参照Grid使用说明
### 一般常用属性:
提示:hlsGrid的使用请参照Grid的使用说明
| 属性 | 类型 |
| :--- | :--- |
| id | |
| dataSource | |
| hlsBtnType | |
| editable | |
| height | |
| AutoResize | |
| ResizeAble | |
| navigatable | |
| localte | |
### 用法:
提示:因为单独属性不能显示,这里先介绍一些写法,会在写法的最后给出图片展示
##### 1.hlsGridId
说明:要和子标签hlsGrid的id保持一致
```html
<h:hlsGridBox hlsGridId="grid">
<h:hlsGrid id="grid" dataSource="gridDataSource" >
</h:hlsGrid>
</h:hlsGridBox>
```
##### 2.hlsBtnType
说明:hlsBtnType有几种形式:add,delete,query,save,upload。可以都写上但不可以重复
```html
<h:hlsGridBox hlsGridId="grid" hlsBtnType="add,save,query" >
<h:hlsGrid id="grid" dataSource="gridDataSource" hlsBtnType="DELETE" >
</h:hlsGrid>
</h:hlsGridBox>
```
##### 3.title
说明:显示在表格上面的标题
```html
<h:hlsGridBox hlsGridId="grid" hlsBtnType="add,save,query" title="任务维护" >
<h:hlsGrid id="grid" dataSource="gridDataSource" hlsBtnType="DELETE">
</h:hlsGrid>
</h:hlsGridBox>
```
##### 4.queryId
说明:查询事件
```html
<h:hlsGridBox hlsGridId="grid" hlsBtnType="add,save,query" title="任务维护" queryId="taskDetailQuery">
<h:hlsGrid id="grid" dataSource="gridDataSource" hlsBtnType="DELETE" >
</h:hlsGrid>
</h:hlsGridBox>
<script>
$('#taskDetailQuery').keydown(function (e) {
if (e.keyCode == 13) {
e.target.blur();
viewModel.queryFunction(e);
}
});
</script>
```
##### 5.viewModelName
说明:数据对象渲染
```html
<h:hlsGridBox hlsGridId="grid" hlsBtnType="add,save,query" title="任务维护" queryId="taskDetailQuery" viewModelName="viewModel.data">
<h:hlsGrid id="grid" dataSource="gridDataSource" hlsBtnType="DELETE" >
</h:hlsGrid>
</h:hlsGridBox>
<script>
var viewModel = kendo.observable({
isEnabled: true,
data: {
},
queryFunction:function(e){
$('#grid').data('kendoGrid').dataSource.page(1);
},
});
</script>
```
##### 6.dataSourceId
说明:数据源,和子标签hlsGrid中的数据源一致
```html
<h:hlsGridBox hlsGridId="grid" hlsBtnType="add,save,query" title="任务维护" queryId="taskDetailQuery" viewModelName="viewModel.data" dataSourceId="gridDataSource">
<h:hlsGrid id="grid" dataSource="gridDataSource" hlsBtnType="DELETE" >
</h:hlsGrid>
</h:hlsGridBox>
<script>
$("#grid").kendoGrid({
dataSource:[
{description:"日结",enabledFlag:"Y",jobClassName:"hls.core.hls.job.hlsJobTest",objectVersionNumber:2,taskCode:"EXAMPLE_1",taskName:"任务1"},
{description:"周结",enabledFlag:"Y",jobClassName:"2",objectVersionNumber:2,taskCode:"EXAMPLE_2",taskName:"任务2"},
{description:"月结",enabledFlag:"Y",jobClassName:"3",objectVersionNumber:2,taskCode:"EXAMPLE_3",taskName:"任务3"}
]
})
</script>
```
图片展示:
![](/assets/1303.png)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment