Skip to content
This repository has been archived by the owner on Jul 17, 2018. It is now read-only.

Commit

Permalink
Basics of saving.
Browse files Browse the repository at this point in the history
  • Loading branch information
icco committed Dec 30, 2011
1 parent 1511873 commit 64db3d4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions public/javascripts/application.js
Expand Up @@ -17,7 +17,7 @@ function Item() {
};

this.save = function() {
localStorage[item.id] = JSON.stringify(this);
localStorage[this.id] = JSON.stringify(this);
};
}

Expand Down Expand Up @@ -105,9 +105,16 @@ $(document).ready(function() {

// Makes each field editable.
$('td', $('#items').dataTable().fnGetNodes()).editable(function(value, settings) {
console.log(this);
console.log(value);
console.log(settings);
var id = $(this).parent().children().html();

var item = new Item();
item.id = id;
item.description = 'desc';
item.type = 'b';
item.creator = 'a';
item.suggested_price = 0;
item.sale_price = 0;
item.save();

// We must return what we want to display.
return(value);
Expand Down

0 comments on commit 64db3d4

Please sign in to comment.