DevExtreme 学习应用[3]
DevExtreme dxSelectBox 联动查询案例
//数据获取
lookupDataSource = new DevExpress.data.DataSource({
store: storeInitValue, //数据源
sort: { getter: "time", desc: true }, //排序
filter: ["ProjectKey", "=", Application1.ProjectKey], //过滤
map: function (item) {
return new ini_valueViewModel(item);
}
}); //数据更新
function handleDataSourceChanged() {
isReady.resolve();
lookupDataSource.off("changed", handleDataSourceChanged);
}
lookupDataSource.on("changed", handleDataSourceChanged); return {
typedatasourceChange: function (e) {
//从新更新数据
lookupDataSource.filter([["ProjectKey", "=", Application1.ProjectKey], '&&', ["TypeName", "=", e.value]]);
lookupDataSource.reload();
//数据重新加载
},
typedatasource: typedatasource, //类型
lookupDataSource: lookupDataSource, //名称
control: control,
handleSave: handleSave,
handleCancel: handleCancel,
viewShowing: handleViewShowing,
isReady: isReady.promise()
};
<div data-options="dxView : { name: 'ControlEdit', mode: 'edit', title: '测点设置' } ">
<div data-bind="dxCommand: { onExecute: handleSave, id: 'save', title: 'Save', icon: 'save' } "></div>
<div data-bind="dxCommand: { onExecute: handleCancel, id: 'cancel', behavior: 'back', title: 'Cancel', icon: 'close' }"></div>
<div data-options="dxContent : { targetPlaceholder: 'content' } " class="dx-edit-view dx-content-background dx-form-background" data-bind="dxDeferRendering: { showLoadIndicator: true, staggerItemSelector: '.dx-field', animation: 'edit-item-rendered', renderWhen: isReady }">
<div data-bind="dxScrollView: { }">
<div class="dx-fieldset">
<div class="dx-field">
<div class="dx-field-label">测点类型: </div>
<div data-bind="dxSelectBox:{
dataSource: typedatasource,
placeholder: '测点分类',
displayExpr: 'Name',
valueExpr: 'TableName',
value: control.TypeName,
onValueChanged:typedatasourceChange}">
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">测点名称: </div>
<div data-bind="dxSelectBox:{
dataSource: lookupDataSource,
placeholder: '测点编号',
displayExpr: 'name',
valueExpr: 'name',
value: control.name}">
</div>
</div> <div class="dx-field">
<div class="dx-field-label">控制值: </div>
<div class="dx-field-value" data-bind="dxNumberBox: { value: control.WarningUp, placeholder: '控制值' }"></div>
</div>
<div class="dx-field">
<div class="dx-field-label">报警值: </div>
<div class="dx-field-value" data-bind="dxNumberBox: { value: control.EarlyWarningUp, placeholder: '报警值' }"></div>
</div>
</div>
</div>
</div>
</div>
DevExtreme 学习应用[3]的更多相关文章
- DevExtreme 学习应用[2]
DevExtreme 学习应用[2] 调用WebService数据 1那么首先建立WebService using System; using System.Collections.Generic; ...
- DevExtreme 学习应用[1]
DevExtreme学习开发 [1] 用HTML开发手机应用,看一哈帮助文档觉得还很不错. 在开发前一定要安装DevExteme 下载连接地址: ftp://211.101.1.108/DevExp ...
- DevExtreme学习笔记(一) DataGrid中MVC分析
@(Html.DevExtreme().DataGrid() .ID("gridContainer") .DataSource(d => d .OData() .Url(&q ...
- DevExtreme学习笔记(一)treeView(搜索固定、节点展开和收缩)注意事项
var treeConfig1 = dxConfig.treeView(obj_Question.treeDataSource1); treeConfig1.selectionMode = 'sing ...
- DevExtreme学习笔记(一) DataGrid中数据提交注意事项
1.数据提交的{}数据需转化json格式 syncPost('/controller/action', { values: JSON.stringify({d:x}) }, function (res ...
- DevExtreme学习笔记(一) DataGrid中数据筛选
config.filterRow = { visible: true, applyFilter: "auto" }; config.headerFilter = { visible ...
- DevExtreme学习笔记(一) DataGrid中注意事项
1.阻止cell编辑 config.onEditorPreparing = function (e) { if (e.dataField === 'xx' && e.row.data. ...
- DevExtreme学习笔记(一) DataGrid中js分析
1.overviewjs采用 $(function() { $("#gridContainer").dxDataGrid({ dataSource: { store: { type ...
- ABP 基于DDD的.NET开发框架 学习(五)中使用DevExpress插件
1.DevExpress安装 安装步骤1:开始安装 安装步骤2:选择需要安装的模块 安装步骤3:修改安装路径 安装步骤4:正在安装 安装步骤5:安装完成 2.Vs中设置 1)DevExtremeBun ...
随机推荐
- HDU6235-Permutation-水题-2017中国大学生程序设计竞赛-哈尔滨站-重现赛
Permutation Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Tot ...
- c++(堆排序)
堆排序是另外一种常用的递归排序.因为堆排序有着优秀的排序性能,所以在软件设计中也经常使用.堆排序有着属于自己的特殊性质,和二叉平衡树基本是一致的.打一个比方说,处于大堆中的每一个数据都必须满足这样一个 ...
- JAVA爬虫实践(实践四:webMagic和phantomjs和淘宝爬虫)
webMagic虽然方便,但是也有它不适用的地方,比如定向的某个单页面爬虫,或者存在大量ajax请求,页面的跳转请求全都混淆在js里. 这时可以用webMagic结合phantomjs来真实模拟页面请 ...
- [国嵌攻略][068][tftp网络协议实现]
IP协议结构 UDP协议结构 TFTP协议结构 TFTP端口 读写请求端口: 69 其他请求端口:1024~65535 主程序 /*********************************** ...
- Redis在Php项目中的实际应用场景
前言 一些案例中有的同学说为什么不可以用string类型,string类型完全可以实现呀 我建议你看下我的专栏文章<Redis高级用法>,里面介绍了用hash类型的好处 商品维度计数 对商 ...
- 【翻译】A Next-Generation Smart Contract and Decentralized Application Platform
原文链接:https://github.com/ethereum/wiki/wiki/White-Paper 当中本聪在2009年1月启动比特币区块链时,他同时向世界引入了两种未经测试的革命性的新概念 ...
- Centos6.9安装部署nginx服务器
(一)依赖包安装 首先,gcc,pcre,zlib,openssl安装一边(可以用非-devel,但是嫌麻烦....用非-devel的看这个链接) yum -y install gcc ------ ...
- Thrift之TProtocol系列TJSONProtocol解析
在了解JSON协议之前,朋友们可以先去了解一下JSON的基础知识,和ASCII基本分布,关于JSON一些常识请见这里; JSON (JavaScript Object Notation)是一种数据交换 ...
- 【笔记】BFC 模型知识整理
网上看了很多 BFC 的概念,发现都说得不是很完整和深入,刚好最近看了一些视频教程说到了 BFC 概念所以记录一下. BFC 的概念: BFC 全称:Block format context 块级格式 ...
- Linux - ubuntu 设置固定ip和设置dns
ubuntu 设置固定ip和设置dns 1.ifconfig 查看网卡名称 root@jiqing-virtual-machine:~# ifconfig ens32 Link encap:以太网 硬 ...