Access Categories.find({}) result from template helper - meteor

I'm retrieving a list of categories (and subcategories) from Mongo and I need to bind these values to a list of html elements that represent the categories in the view.
When I retrieve this from the server I save it in a Session object. I'm trying to write a loop that goes through this object and binds the data with jQuery.data() to the list html elements.
However I can't access the collection from within the Session object in Meteor. I can in the browser! I can drill down to categories.collection.queries[1].results and I can see the category objects. If I use this in Meteor I get undefined error.
Any ideas what I'm doing wrong? Many thanks
As suggested in the comments I'm already using {{#each categories}} in my template. But once the categories are rendered I want to bind data values to them from the same collection.

Related

Unable to write table from multiple pages into collection in blueprism

I'm extracting the data from a table that is spread across several web pages. I'm trying to fetch data per page and write into the same collection. For this I have given same collection in the output of these pages.
The problem is that the data instead of getting added is getting overwritten in the collection.
Well, that's how it works! When you read the data into the collection then the previous data is being overwritten. That's the same as other data items :)
The solution is simple - read the data into temporary collection first.
Afterwards, use action:
object: Utility - Collection Manipulaiton
action: Append rows to collection
That will join the rows from your temporary one to the main one.

What is the syntax to add a column to the Custom Form list that shows where in WF it is used?

Super simple.
When viewing the list of Custom Forms in Setup, I want to add a column that shows where those Custom Forms are in use (or null if used nowhere).
This is similar in principle to viewing the list of fields, which has a list of forms on which those fields are used.
What is the syntax I can use to add the appropriate column(s) to the view?
As far as I know, there is no linkage in the backend that connects categories (custom forms) to their host objects. This is probably because the list could be massive and the query would take quite a while to execute as it would have to traverse every object in Workfront or each form would store every parent object ID.
Unfortunately, you can't even search for objects by associated category IDs, so if you wanted to build this yourself you would need to query each object and search its categories to see if your custom form appeared.

Displaying data in a datagrid in an Alfresco task form

I have a json array variable defined in my activity workflow definition. Now, I need to present the data of the json array in a datagrid inside a form task. One of those columns should be a check entry filed so that the user may select some rows. After that, I need to get back that data in a subsequent form task (so I need the data to be updated in the json variable so I can read it back, mainly the user selected checks).
Any example to accomplish this? I didnt find almos nothing relating with using datagrids in Alfresco task forms.
thank you!
Miguel

Handlebars templatig: Difference between empty list and list not given

I am creating summary eMails with recent activities that can be configured by the recipient. For that I am using Mandrill with the Handlebars templating syntax and {{#each objects}} passing in objects.
That all works fine. And I can use the {{else}} to display a message when that list is empty. (That event hasn't happened in the referenced period of time)
But now I want to give the user the option to never see a summary about that particular kind of event (no matter whether they exist or not). I tried using {{#if objects}} and simply not adding the parameter for that user. But that results in the entire block not showing up when the list is empty. But in that I case I just want to say something like "no recent activity in this category" which has been working fine so far.
TL;DR: How to differentiate between parameter not given and empty list given with handlebars.

POST Complex objects to controller

I am working on an enterprise scale project where I have a self referencing table called categories as below. Also in my current model I am using following table associations to fetch data. ( using EF6).
I have M-M mapping tables in DB for above M-M relationships.
In my controller GET action result returns the model which has Ilist(all parent categories). Then when the user is selecting items (in view) I am using Ajax to retrieve Ilist for next subset of categories (by passing to controller by Id - return Json result) and dynamically show next to the parent select list as below. ( and I have up to 4 subsets)
As the user is selecting categories, I am using Ajax call to load related categories and create selectlist or dropdownlist dynamically as below:
My question is Since all these data is loaded through Ajax, how can I bind them to my parent model. How can I capture user selected data into one parent model when user is posting the from to controller.
I know I can use Ajax and use Json to capture & transfer to contoller , But I need to use modelview , Can I use partiview to overcome this ?
Please advise the available options..
The key is making sure the name values match the object hierarchy accepted by the post operation. This is certainly doable; it's difficult because several AJAX operations build the UI, but one operation processes it, so you have to ensure the data expressions match the object being posted back.
You can use Html.NameFor() as a workaround to ensuring the naming paths work OK. Collections can make this difficult.

Resources