首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

knockoutjs - all built-in buildings

2012-07-01 
knockoutjs -- all built-in buildings所有可用的binding值文字和显示:visible, text, html, css, style,

knockoutjs -- all built-in buildings
所有可用的binding值
文字和显示:visible, text, html, css, style, attr流程控制:foreach, if, ifnot, withform字段:click, event, submit, enable, disable, value, hasFocus, checked, options, selectedOptions, uniqueName模版:template自定义blinding

event:
Passing a “current item” as a parameter to your handler function
Accessing the event object, or passing more parameters
Allowing the default action
Preventing the event from bubbling

data-bind="event: { mouseover: enableDetails, mouseout: disableDetails }data-bind="event: { mouseover: function(data, event) { myFunction(data, event, 'param1', 'param2')


如果在流程控制的Binding,如foreach、with中嵌套了其他binding,那么通常需要使用前缀访问。
$parent — is the data item outside the current foreach block
$parents -- 多层流程控制嵌套时
$parents[0]
$root

热点排行
Bad Request.