Page 3 of 3

Generate PDF from client side from user input

Posted: Mon Aug 25, 2014 5:48 pm
by R2R

I've begun developing a collection for each checklist, so that I can at least output the data to an email before I learn how to create a PDF. I want to save each item AND its status ("checked" or "unchecked") in the database for each user that is logged in. The content in the checklist should populate into the database columns per the image below. Also, I don't want to just keep adding rows each time a checkbox is marked or unmarked. Instead, I want that item to be found in the database and its status updated. This should all happen when I click the button in the upper right corner.

There are 11 items in the first collection, so when I click the button in the upper right corner, there should be 11 items created in the database and each item should have a status assigned - either "checked" or "unchecked."

This should be fairly easy, and I'm binding each item in the list to a variable, but I don't know how to map the items in the createService service.

Image


Generate PDF from client side from user input

Posted: Mon Aug 25, 2014 11:19 pm
by Yurii Orishchuk

Hi R2R,

1 If you want to update items instead of create new each time - you need to create them(items) for each user. For example you can create them on user registration success event. Server script could be useful for this goal.

2 You should populate your list from DB by query with current user "_id". So app gets from this query only items for current user thus you can correctly populate items with data.

3 When you click on "save" button you need:
3.1 Get all items with their values.
3.2 Update all items separately with update service. Or you can implement your own server script that's accepts all items in single request and update these items.

Regards.