-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbbug.js
More file actions
41 lines (34 loc) · 875 Bytes
/
bbug.js
File metadata and controls
41 lines (34 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
MyList = new Meteor.Collection("items")
MyList.allow({
update: function() {
return false;
}
});
if (Meteor.isClient) {
Template.alist.dpoint = function () {
return MyList.find({});;
};
Template.listitem.rendered = function () {
console.log("listitem rendered");
this.$('.editable').editable(
function(value, settings) {
MyList.update($(this).attr('id'), {$set: {total: parseInt(value)}});
return (value);
}
, {
type : 'text',
style : 'inherit',
width : 100,
submit : 'OK',
});
};
}
if (Meteor.isServer) {
Meteor.startup(function () {
MyList.remove({});
MyList.insert({item: 'first', price:'10'});
MyList.insert({item: 'second', price:'100'});
MyList.insert({item: 'third', price:'1000'});
MyList.insert({item: 'fourth', price:'10000'});
});
}