Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislas Polu committed Apr 18, 2012
1 parent 8e8e5a1 commit 5fb9b0d
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions ReadMe.md
Expand Up @@ -4,3 +4,100 @@

The concept of cells is largely inspired by the work introduced by Google in its GWT framework [http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/cell/client/Cell.html]

#### Basic Cell

```javascript
/************************************/
/* BASIC CELL */
/************************************/

var basic_c = function(spec, my) {
var _super = {};
var my = my || {};

// public
var build; /* build(); */
var refresh; /* refresh(); */

// private

var that = CELL.cell(spec, my);

/**
* builds the cell static content
*/
build = function() {
// ...
};

/**
* refreshes the cell content with received data
* @expected { ... }
*/
refresh = function(json) {
// ...
_super.refresh(json);
};


CELL.method(that, 'build', build, _super);
CELL.method(that, 'refresh', refresh, _super);

return that;
};
```

#### Basic Container

```javascript
/************************************/
/* BASIC CONTAINER */
/************************************/
/**
* @param sepc {}
*/
var basic_t = function(spec, my) {
var _super = {};
var my = my || {};

// public
var load; /* load(); */
var refresh; /* refresh(); */

// private

var that = CELL.container({ name: 'basic' }, my);

/**
* loads children cells within the DOM
*/
load = function() {
var elem = $('#some_id');

// Construction
my.children['basic'] = basic_c({ path: my.path + '/basic', container: that });
elem.append(my.children['menu'].build());

// Handlers
my.children['basic'].on('some_event', function() {
// ...
});

// Start Updates
};

/**
* refreshes the UI with new version of data
*/
refresh = function() {
// ...
_super.refresh();
};


CELL.method(that, 'load', load, _super);
CELL.method(that, 'refresh', refresh, _super);

return that;
};
```

0 comments on commit 5fb9b0d

Please sign in to comment.