Hi Matt, I was chatting with Cindy, about this. It could be that the operations occurring as a result of the event are happening in a different order that what was. For instance, the page list rendering also seems to occur based on this event.
https://github.com/fluid-project/infusion/blob/infusion-1.5/src/components/pager/js/Pager.js#L247 You can try to force the call to initDragAndDrop to happen later than other events by settings a priority. If you look at the signature of the addListener method https://github.com/fluid-project/infusion/blob/infusion-1.5/src/framework/core/js/Fluid.js#L1105 you can see that there is an argument for priority. This can take a number, but also strings of "first" or "last". The namespace and predicate you can probably just pass in as null or undefined. I hope the helps, please let us know how it goes. Thanks Justin On Jun 25, 2014, at 10:53 AM, Matt Polizzotti <[email protected]> wrote: > Hey Justin, > > Thanks for taking the time to answer my question. In the future I will be > sure to post to the users group. Below is a snippet of our code and how the > pager is being used. Let me know if I should provide additional details. > > Thanks, > Matt > > > 1] First we have a pager implementation that is setup as described below. > Please let me know if you need to see more detail as it pertains to the pager > options. I am trying to simplify the example. > > // Set pager options. > var pagerOptions = { > ... > }; > > // Initialize the pager. > that.state.pager = fluid.pagedTable(container, pagerOptions); > that.state.pager.events.onModelChange.addListener(that.dragManager.initDragAndDrop); > // onModelChange Event. > that.state.pager.events.initiatePageSizeChange.fire(that.options.pageSize); > > 2] The onModelChange event above calls a method on a LayoutDraggableManager > component. The component, listed below, attempts to capture the underlying > list items housed within the pager.container. As it stands now, the list > items captured appear stale. > > up.LayoutDraggableManager = function (container, options) { > var that; > that = fluid.initView("up.LayoutDraggableManager", container, options); > > that.initDragAndDrop = function (newModel, oldModel, pager) { > var galleryList, listItem; > galleryList = pager.container.find(that.options.selectors.galleryList); > listItem = galleryList.find("li"); > // Other work is done to make the list items draggable. > } > } > > > > > > > > > > > > > > > > ----- Original Message ----- > From: "Justin Obara" <[email protected]> > To: "Matt Polizzotti" <[email protected]> > Cc: [email protected] > Sent: Wednesday, June 25, 2014 5:48:23 AM > Subject: Re: Infusion 1.5 Question > > Hi Matt, > > > Do you have any code that you could show us? My first instinct would be that > it may have something to do with an invoker you are using to handle the > event. By default, invokers now cache their values, unless you provide the > "dynamic: true" flag to their configuration. > > > As for venue, it's fine to ask questions here, but you can also ask on the > Infusion-Users list. > > > Thanks > Justin > > > On Jun 24, 2014, at 6:22 PM, Matt Polizzotti < [email protected] > > wrote: > > > Hello Everyone, > > Please let me know if this is not the correct venue to ask a question about > the fluid pager. > > The uPortal community has recently upgraded from fluid 1.4 to 1.5 and we have > an implementation of the fluid pager that leverages the onModelChange event. > When the onModelChange event fires some work is performed on the pager's > underlying list items. After upgrading we noticed that the DOM references to > the list items became stale within the context of the onModelChange handler. > I cannot be absolutely certain that upgrading caused this issue but I wanted > to ask the group if what I have described should be working? Should we be > able to access an updated DOM within the context of an onModelChange handler? > Or are we using the wrong pager event? Please let me know if additional > details are needed. > > Any help would be appreciated. > > Thank you, > Matt Polizzotti > _______________________________________________________ > fluid-work mailing list - [email protected] > To unsubscribe, change settings or access archives, > see http://lists.idrc.ocad.ca/mailman/listinfo/fluid-work _______________________________________________________ fluid-work mailing list - [email protected] To unsubscribe, change settings or access archives, see http://lists.idrc.ocad.ca/mailman/listinfo/fluid-work
