Pop values from a queue created on another view Django - django

I have two views: one that create a queue and add elements inside it and another that is called with an AJAX call, when a button is clicked, from the frontend.
Now I would like to consume the things inside the queue on the view called by AJAX. The issue is that, obviusly, this view doesn't know the queue.
So, my question is, is that a way to pass the queue on this view or is there another way too pass informations between different view in Django?

Related

Trying to add link on d365 model driven app to show all items in a specific queue

I am working in Dynamics 365 online and working inside a model driven app, I'm adding a link on the left side navigation that takes them to a page displaying all items within a specific queue.
However I can only seem to take them to a page that shows All Items I Am Working on, and under that Queues I'm a member of.
No one is a member of any queue since they are public. I just want a simple way to show them all of the queue items inside a specific queue once they click "Physical Mail".
I tried creating a specific view, but since the queue item filter defaults to "Queues I'm a member of" this doesn't work for me.
Is what I am wanting to do possible?
It's very straightforward: when looking at the specific view that you want, copy the URL from the address bar and put it in the Sitemap as "URL" instead of "Entity".
(If the view that you want does not exist, you'll have to first of all create it, of course).

Can’t update existing view with each-in helper

We are creating a Sportsbook web app using Emberjs, where we retrieve data through an API and draw the view.
The received data is an object with many nested levels. Based on this object we have constructed the template file(.hbs) using each-in helper!
We are unable to use 'each' helper as we are receiving object, not array!
After the first retrieval, we are receiving updates every milliseconds and need to update the view as well by changing only the difference.
Sometimes we are receiving new entries in the object, and as the object itself is big, we need to add the new entry to the layout without redrawing the whole stuff.
Here is the problem: Each-in is not observable in this case, so it is not redrawing after pushing the new object.
Question: Is there a good way to implement this with Ember or is there a known helper that we can use instead of each-in, OR is there someone who can recommend me if we CAN create a new helper for this?

Missing views in container after transition to another route

In the OfferRoute I have a container and a controller's method to add views dinamically to it:
addProduct: function() {
var container = Ember.View.views['containerView'];
var child = container.createChildView(Gmcontrolpanel.InsertProductView);
container.pushObject(child);
}
Everything works fine but if I go to another page on the application and then I come back to the offer page, the child views in the container are missing;
I can see that the HTML output is the empty container:
<div id="containerView" class="ember-view"></div>
Does someone know why is this happening?
Views redraws when you switch pages. So, you get a new containerView instance with empty children list every time.
I'm not recommending to use Em.View.views object for that task. If you need to store state of data between redrawing, it's more likely controller job, and containerView needs to bind to this controller.product list and display each product.
It's possible that {{#each}} helper or custom CollectionView is what will help you to solve the task more elegant.

How do I subscribe to events for child elements of a view

My view contains an element. What is the best way to respond to mouseEnter and mouseLeave events for only that element?
Does ember want me to convert that element into a view?
Does ember want me to call this.$().on('mouseEnter', '.my-child-element', someHandler) and .off it myself in didInsertElement and willDestroyElement respectively?
Or am I missing a more appropriate approach?
There are several ways to approach this, but I always come to the conclusion that you create a view for anything that needs to respond to events. You could also use an action handler for very simple events in a template.
{{action "my_action" on="mousedown"}}
I would still recommend using a view though as you will most likely need to know more info about what happened and want access to the view and models bound to that element.

MFC - How to send messages between 2 different Views

I have 2 CView-derived classes, CThumbView and CMainView. The CThumbView class displays thumbnails of images and the CMainView class controls the View that displays the original image.
I want to display the first thumbnail and its original when my application starts up. I tried using OnInitialUpdate, but that is not the ideal way as it bothered the other functionalities that was handling the main view.
How can I do this by sending a user-defined message between the 2 views?
Since you are using the Document View Architecture you need to take advantage of the CDocument::UpdateAllViews function of the document from your view in order to update rest of the views. This function will call OnUpdate of each view.
The data is held by the document. Views access the data & update themselves accordingly.