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>
```
This diff is collapsed.
# 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