WPF/XAML Databinding replica on HTML and jQuery
WPF/XAML Databinding replica on HTML and jQuery. Not entirely the same, of course.
templatename = the id for template
bind = binding for one element
bindcondition = remove element if condition is false. Format = attributeName, operator, value (; is treated as part of value).
bindtemplate = will bind to the template of the specified ID
bindpath = the data path, "" = self, "children" = children, "children/subChildren" = flattened subChildren
format of function = type, path of function; (recommend doing this at end of bind because other bind is static.)
format of attribute, css = type, action, name, path of value;
format of class, html = type, action, path of value;
separated by ;
type = function, attribute, css, class, html
action of attribute, css = add, remove
action of class = add, remove, toggle
action of html = prepend, append, replace
name = static name, like attributeName or cssAttributeName
current draw back = lack of dynamic update.
thought on the issue = will not support dynamic update at all.
In WPF, we use INotitification and ObservableCollection. Implement these not only is difficult, but, add more complexity to the user(programer). Which in term will opens up more bugs and lowers performance.
Instead, recreate everything, assume user client machine is fast enough. If there are some transient values such as selected tab, store it before recreation. Make sure all action binding is done as $().live() to simiplify code.