`
desert3
  • 浏览: 2160741 次
  • 性别: Icon_minigender_1
  • 来自: 合肥
社区版块
存档分类
最新评论

knockoutjs -- all built-in buildings

 
阅读更多
所有可用的binding值
  • 文字和显示:visible, text, html, css, style, attr
  • 流程控制:foreach, if, ifnot, with
  • form字段: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
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics