javascript - Table with empty rows until populated -
i want show table 10 empty rows. user can start entering data first row (the data inserted/updated in mongo collection), once 10th row populated empty row should added end of table , on. table should maintain 10 row view , scroll-able.
is there simple way in meteor?
i assuming store data in collection, should start making 1 of those:
collname = new meteor.collection('collname');
then insert 10 blank items whatever fields want capture (i.e.
[{ "name": "", "comment": "", "something": "" }, { "name": "", "comment": "", "something": "" }, .... { "name": "", "comment": "", "something": "" }]
and iterate on them in template:
{{#each collitems}} <tr> <td>{{name}}</td> <td>{{comment}}</td> <td>{{something}}</td> </tr> ((/each}}
if want show 10 @ time, set limit
10 in template helper / find query.
this should put in right direction, i'd suggest looking @ packages autoform , simple-schema on atmosphere.
Comments
Post a Comment