MVVM架构~knockoutjs系列之级联select
对于下拉列表框的绑定在之前的knockoutjs文章中已经介绍过,今天主要说一下级联的select,事实上,在knockoutjs里,是以数据绑定为中心的,而数据是以面向对象为前提的,而对于级联绑定来说,它也是一种面向对象里关系对象的体现,有了关系对象,我们就可以把级联很容易的开发出来,而不用像之前JS那么麻烦了。
准备数据对象
var Grade_Subject_R = function () {
var self = this;
self.Grades = [
{ 'subjects': [{ 'id': '1', 'name': '语文' },
{ 'id': '2', 'name': '数学' },
{ 'id': '3', 'name': '英语' }],
'arid': '1',
'name': '小学'
},
{ 'subjects': [{ 'id': '1', 'name': '语文' },
{ 'id': '2', 'name': '数学' },
{ 'id': '3', 'name': '英语' },
{ 'id': '4', 'name': '物理' },
{ 'id': '22', 'name': '化学' },
{ 'id': '23', 'name': '生物' }],
'arid': '2',
'name': '初中'
},
{
'subjects': [{ 'id': '1', 'name': '语文' },
{ 'id': '2', 'name': '数学' },
{ 'id': '3', 'name': '英语' },
{ 'id': '4', 'name': '物理' },
{ 'id': '22', 'name': '化学' },
{ 'id': '23', 'name': '生物' },
{ 'id': '24', 'name': '历史' }],
'arid': '3',
'name': '高中'
}
]; self.grade = ko.observable();
self.subject = ko.observable(); /*
当前选中的年级ID为self.grade().id
当前选中的学科ID为self.subject().id HTML代码:
<select data-bind="
options: Grades,
optionsText: 'name',
value:grade,
optionsCaption: '选择年级'">
</select>
<span data-bind="with:grade">
<select data-bind="
visible: $parent.grade,
options: Subjects,
optionsText: 'name',
value:$parent.subject,
optionsCaption: '选择学科'">
</select>
</span> <span data-bind="with:grade">
<!-- ko foreach: Subjects -->
<input type="checkbox" data-bind="value: id, checked: $root.subject" />
<span data-bind="text: name"></span>
<!-- /ko -->
</span> */ }
JS代码
var model = new Grade_Subject_R();
ko.applyBindings(model); for (var i in model.Grades) {
if (model.Grades[i].arid == "") {
model.grade(model.Grades[i]);
break;
}
}
HTML代码
<select data-bind="
options: Grades,
optionsText: 'name',
value:grade,
optionsCaption: '选择年级'">
</select>
<!-- ko with:grade -->
<select data-bind="
visible:$parent.grade,
options: subjects,
optionsText: 'name',
value:$parent.subject,
optionsCaption: '选择学科'">
</select>
<!-- /ko -->
效果截图
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKgAAADUCAIAAACHyf9ZAAAKwklEQVR4nO2dPW7jOBTHVU87V0jPK8wp0rEP5hTbEsgBfAxikSaADzBlBpAvkCZAioGxzZTcgt/koz6cKKb8/j8Y2J1Ykk39+EiKFp8GA1gyXPsLgOsA8UyBeKZAPFMgnikQz5RZ8aMSwyDU2HwzeU/LYRikTt5t7Wi0tFsWR4hvCqVk83PBh6HEazlMkqmNf7C7STWO2btCSpHtrKW1GsRXFUvLYRBS+23ABlwc8c45Tdh+VEKIcIBRiVK8j3nVqmwwvw2k+CVSRyWClaxy2HZ6jC39qIQNe6ko8QRFlwE2YMOIH7UUwyD1hHh/kEJyWqnANhDi57r4pHOejHiTBHs74t1x0nokFcRvzlTEazn4sVk0nDqd6w5M2HJWfPg8qU1eecAmNMW7uE+C26uujTQv+ezwXIpBCDEIpVeKJ6/1wKdAircGkgY3hHfatk8j1JhI1XIYhLDNBSVeSqHG0Mf4j4b47aD7+CAr6dbdZTrV8zYi3nt3b6v0ADoTXw4g4jUevG/ERB+fNPbF30r7tHjXcqf9tZY+nEOX0bp0s58E71uBuXqmQDxTIJ4pEM8UiGcKxDMF4pkC8UyBeKZAPFMgnikQzxSIZwoh/p9bh3l5p8T/uF3Gl1/Myzsjnty6Q8aXX8tf5IngVl7LLYhfuKUt1w2IX7hlq7yWGxG/pPrfkviPlNcC8ezKa1kqflRi1QqHtdtfzBbidbK+S0t3a3B9+194q72wIC5E8Lew+g/ID1evHW2dwK+P+FHJeHfkxPqJ6e/96WwU8XZ9J30feVEnTFEtitXhlfuyCmTHDOetB/HZ8iZqSU26TLrFVtVgy6Y+KWUR8ekpCStD/eKTROLUGYnxUlUFW+WuLj75SlXFzMTn1T753hvGf3oiyNO7Wjx1W/lUU5/v1j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Ibn0LUcqMe4gtk4qfqO90GIW3hhw5/YyGeAPE8qfhgt9ep0jy046fMNqof4nmyiRhu3iQROTXkor2wunjORbOZAOJ5MFYvFIgXCsQL5fn5+devX+XhmHuAphfihQLxQoF4oUC8UCBeKBAvFIgXCsQLBeKFAvFCgXihQLxQIF4oEC8UiBcKxAsF4oUC8UKBeKFAvFAgXigQL5T/AaVY/Ee4bvvUAAAAAElFTkSuQmCC" alt="" />
MVVM架构~knockoutjs系列之级联select的更多相关文章
- MVVM架构~knockoutjs系列之表单添加(验证)与列表操作源码开放
返回目录 本文章应该是knockoutjs系列的最后一篇了,前几篇中主要讲一些基础知识,这一讲主要是一个实际的例子,对于一个对象的添加与编辑功能的实现,并将项目源代码公开了,共大家一起学习! knoc ...
- MVVM架构~Knockoutjs系列之验证机制的引入
返回目录 对于Knockoutjs本身来说,没有提供验证模块,不过,有第三方的扩展,就像你为jquery库作extensions一样,这讲中我将介绍一个Knockout插件扩展,knockout.va ...
- MVVM架构~knockoutjs系列之包括区域级联列表的增删改
返回目录 这个例子我做了几次,之前总是有BUG,目前测试后,确定没有BUG才发上来的,主要功能是实现“我的银行”模块的增删改的功能,这个里面包括了级联列表的区域选择,这部分是难点,在开发过程中,我们应 ...
- MVVM架构~Knockoutjs系列之text,value,attr,visible,with的数据绑定
返回目录 Knockoutjs是微软mvc4里一个新东西,用这在MVC环境里实现MVVM,小微这次没有大张旗鼓,而是愉愉的为我们开发者嵌入了一个实现MVVM的插件,这下面的几篇文章中,我和大家将一起去 ...
- MVVM架构~knockoutjs系列之正则表达式使规则更灵活
返回目录 几乎每种验证架构都会有正则表达式的加盟,一般地,一种验证架构首先会提供一些标准的,常用的验证规则,它们通常是数字验证,电话验证,email验证,长度验证,范围验证,日期验证等,而如果使你的验 ...
- MVVM架构~knockoutjs系列之验证信息自定义输出~再续
返回目录 对于一个项目的表单验证,方式有很多,效果也有很多,具体使用哪种完成取决于产品这边,产品让你用什么,你就要用什么,而做为开发人员,我们要做的就是"整理近可能多的架构方式",这样才可以自由的应变 ...
- MVVM架构~Knockoutjs系列之对象与对象组合
返回目录 在面向对象的程序设计里,对象是核心,一切皆为对象,对象与对象之间的关系可以表现为继承和组合,而在Knockoutjs或者JS里,也存在着对象的概念,今天主要说一下JS里的对象及对象的组合. ...
- MVVM架构~Knockoutjs系列之js接收C#数据集合的方式
返回目录 在controller里将数据拿到,并且存储到ViewBag对象里,最后在View上显示出来,这是传统的MVC开发方式,事实上引入Knockoutjs以后,这种方式还是适合的,Knockou ...
- MVVM架构~knockoutjs系列之从Knockout.Validation.js源码中学习它的用法
返回目录 说在前 有时,我们在使用一个插件时,在网上即找不到它的相关API,这时,我们会很抓狂的,与其抓狂,还不如踏下心来,分析一下它的源码,事实上,对于JS这种开发语言来说,它开发的插件的使用方法都 ...
随机推荐
- hasOwnProperty和in
返回一个布尔值,指出一个对象是否具有指定名称的属性. hasOwnProperty 此方法无法检查该对象的原型链中是否具有该属in 可以检查原型链中是否具有该属
- 检查Chunksum与Chunk Data之间的缓冲区发送到DataNode节点
我们会看到左边"iOS Apps"下面有四个选项:"Certificates"."Identifiers"."Devices&qu ...
- python ImportError: DLL load failed: %1 不是有效的 Win32 应用程序
导入的时候报出了 ImportError 在windows上安装python 的模块后,导入模块时报 python ImportError: DLL load failed: %1 不是有效的 Win ...
- PHP二维数组排序
$arrays 要排序的数组 $sort_key 根据排序的key $sort_order 升序降序 SORT_ASC/SORT_DESC $sort_type 排序key类型 SORT_N ...
- C++builder中使用TScrollBox 以后,让scrollBox相应鼠标的上下滑动
1.在窗口的事件里搜索 mouseWheel的方法 2.在.cpp文件里实现下面的代码 void __fastcall TForm1::mouseWheel(TObject *Sender, TShi ...
- 如何删除选中的checkbox
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Log4j的ConversionPattern无缝适配到Logback
为了能将log4j的ConversionPattern无缝应用到logback上来,需要对两个Conversion做适配,具体可以参考:Log4j 与 Logback的ConversionPatter ...
- mysql监控和优化(2)
mysql主从复制 3个线程完成复制:主库1个线程负责记录数据库变更日志从库1个线程负责拉取主库的变更日志从库1个线程负责执行主库的变更日志实现了获取事件和重放事件的解耦,允许异步进行.复制的瓶颈:主 ...
- Linux内核分析之扒开系统调用的三层皮(下)
一.实验内容 1. 通过内核的方式使用系统调用 需要使用的命令 rm menu -rf //强制删除当前menugit clone http://github.com/mengning/menu.gi ...
- uva 11137 Ingenuous Cubrency
// uva 11137 Ingenuous Cubrency // // 题目大意: // // 输入正整数n,将n写成若干个数的立方之和,有多少种 // // 解题思路: // // 注意到n只有 ...