It helps you to develop javascript enhanced forms defining relationship between elements.
Quickly, it make possible to calcute element values like in spreadsheets.
Import the Mootool library and the MooCell library in the middle of your head tag
#head <script type="text/javascript" src="mootools.js" /> <script type="text/javascript" src="MooCells.js" />
99.999% of times you surely need a good domready
window.addEvent("domready", function(){ //second step here });
Create an instance of MooCells in the function passed to the domready event
window.addEvent("domready", function(){ new MooCells({ cells: { cellA: { el: document.id("idForCellA"), }, cellB: { el: document.id("idForCellB"), status: "disabled", value: function(cells) { return cells.cellA * 5 } } }, onComputing: function(status) { console.log("calculating cells values - ", status); }, onCellChange: function(cell) { console.log(cell, "has changed"); } }); });
http://nkjoep.github.com/MooCells/
format: an object {} contaning information about how to format types. Now allowed value is:
format: { decimals: <number> }
For each cell you have to define a structure like this:
cellkey : { // (String) el: , // (Element - mandatory) status: , // (String - optional) format: , // (String - optional) decimals: , // (Number - optional) dependsOn: , //(Array[String] - optional) value: //(Function(cells) - optional), onUpdate: // Function(value) - optional }
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus