Spreadsheet-like formulas on the DOM

前端 未结 6 1273
一个人的身影
一个人的身影 2021-02-13 20:46

I am looking for a way to dynamically bind formulas throughout my DOM.

We have a data intensive app, and currently I write many handlers to try and recalculate and updat

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-13 21:46

    You're going to want a framework like Backbone.js or Knockout


    Backbone.js

    http://documentcloud.github.com/backbone/

    Cited from Backbone: With Backbone, you represent your data as Models, which can be created, validated, destroyed, and saved to the server. Whenever a UI action causes an attribute of a model to change, the model triggers a "change" event; all the Views that display the model's state can be notified of the change, so that they are able to respond accordingly, re-rendering themselves with the new information. In a finished Backbone app, you don't have to write the glue code that looks into the DOM to find an element with a specific id, and update the HTML manually — when the model changes, the views simply update themselves.


    Knockout.js

    http://www.knockoutjs.com/

    Cited from Knockout JS: By encapsulating data and behavior into a view model, you get a clean, extensible foundation on which to build sophisticated UIs without getting lost in a tangle of event handlers and manual DOM updates.

提交回复
热议问题