mikeric / rivets

Lightweight and powerful data binding.
http://rivetsjs.com
MIT License
3.23k stars 310 forks source link

[Demo] custom checkbox using rivets #227

Closed nsisodiya closed 9 years ago

nsisodiya commented 11 years ago

Here is a demo for custom checkbox using rivets - http://jsfiddle.net/nsisodiya/6q6xL/ I need you to review it and correct if there is any problem in the code !!

Rivets can can useful to create new custom tag/attribute library !! something like

<div ui-popup="true" ></div> will open div in popup or window style, <div ui-zenmode="true" ></div> will open div in zen style editing popup,


I have one more question ! in my code, this code is working --

adapter.subscribe(this.model[this.key.path], "checked", this.callback);

but when i change it to

adapter.subscribe(this.model, this.key.path + ".checked", this.callback);

this code is not working !!


In rivets.js, I have see the code like

    read: function(obj, keypath) {
      return obj[keypath];
    },

So, if the value of keypath is "data.status" then it will not give correct property, as OBJ["data"]["status"] is not equal to OBJ["data.status"]

nsisodiya commented 11 years ago

Also... In the above demo

{scope.checkboxData | json}

is not working !!

benadamstyles commented 9 years ago

Closing as it's very old and doesn't seem to present an issue with rivets itself