marionette

Backbone Marionette Composite View Rendering

℡╲_俬逩灬. 提交于 2020-01-06 12:43:25
问题 Problem in short: Initializing a composite view in marionette with a collection of size ~500 stalls the app for around a minute. I'm building a backbone marionette app to maintain a list of items. When testing with a collection size of ~50 everything is fine. When the limit grows, app goes unresponsive. Store.ItemsListView = Marionette.CompositeView.extend({ tagName: "div", template: "#items-list", itemView: Store.ItemView, itemViewContainer: "tbody", emptyView: Store.NoDataView, }); Store

Marionette js access to app from controller with requirejs

蓝咒 提交于 2020-01-05 04:56:21
问题 I want to get access to my main app instance from main controller to render new View. What i want to do is commented in controller/main.js code, as i understand this is circ dependency in require js, but i don't understand how to fix this file structure - controllers/main.js - models/ - templates/ - views/ - app.js - main.js - router.js main.js require.config({...}) require(['app'], function(app) { app.initialize().start(); }); app.js define(['jquery', 'underscore', 'backbone', 'marionette',

WebDriverException: Message: [Exception… “Failure” nsresult: “0x80004005 (NS_ERROR_FAILURE)” while saving a large html file using Selenium Python

瘦欲@ 提交于 2020-01-05 04:22:10
问题 I'm scrolling through the Google Play Store and the reviews for an app, specified by the URL to the app page. Selenium then finds the reviews and scrolls down to load all reviews. The scrolling part works, without the headless option I can watch Selenium reaching the end of the site. What's not working is saving the html content for further analysis. Based on other answers I tried different methods for saving the source code. innerHTML = DRIVER.execute_script("return document.body.innerHTML")

serializeData vs. templateHelpers?

社会主义新天地 提交于 2020-01-04 13:39:15
问题 In Marionette, afaik these two snippets achieve the same purpose: serializeData: function() { data = super; data.foo = "bar"; return data; } and templateHelpers: function() { return { foo: "bar" } } What would be the difference and when to use one or the other? 回答1: In your example I can't think of any practical difference. Semantically, though, I think that serializeData() is the better fit when you're transforming the existing model data into something else. It's more complicated to use,

Backbone Marionette CompositeView sorted list - renders extra model on add

此生再无相见时 提交于 2020-01-04 09:13:22
问题 Here's the fiddle: http://jsfiddle.net/QhQ8D/10/ Code is down below. Making a chat app and need a sorted, connected user list. Figured Collection with a comparator on name hooked to a CompositeView should do it. Am I doing something wrong in the implementation here? HTML: <div>Enter user name and hit add user to build your list</div> <div id="divadduser"> <input id="inputusername"/> <input id="buttonadduser" type="button" value="add user"/> </div> <div id="divusers"></div> JAVASCRIPT: var

Uncaught TypeError: Cannot read property 'app' of undefined

荒凉一梦 提交于 2020-01-03 01:47:10
问题 I have a composite view: var resultView = Marionette.CompositeView.extend({ template : ResultPanel, itemView : ResultItemView, initialize : function() { ... }, itemViewOptions : { app : this.options.app }, I just want to assign this view's app property to itemView's app property. So i can use this view's app from other view. But I'm getting this error: Uncaught TypeError: Cannot read property 'app' of undefined. What am i doing wrong? Is there another way in order to do this? 回答1: possiblity

Understanding Backbone and Marionette View lifecycle

泄露秘密 提交于 2020-01-01 09:08:07
问题 I'm new to this world and I need to understand some of the concepts of Backbone and Marionette. Here I'm trying to explain some of the concepts I'm learning. It would be great to having some feedback on them. The render function defines the logic for rendering a template. When it is finished, the onRender callback is called. Here I suppose the rendered view has been not attached to the DOM. It is composed by a tagName (the default is div ) that contains the template I attached to it. To

Backbone.Marionette CollectionView callback when all itemViews have finished rendering?

 ̄綄美尐妖づ 提交于 2020-01-01 05:27:09
问题 I'm using the marionette Layout .show to render a CollectionView and was wondering if there is a way of detecting when all the ItemView children have finished rendering? A simplified version of my code is: Layout Layouts.Group = Backbone.Marionette.Layout.extend({ template: Templates.group, ... regions: { header: ".group-header" details: ".group-details" }, ... }); CollectionView Views.GroupDetail = Backbone.Marionette.CollectionView.extend({ itemView: groupDetailRow, ... onRender: function (

How do you properly display a Backbone marionette collection view based on a model javascript array property?

我只是一个虾纸丫 提交于 2020-01-01 05:26:08
问题 * UPDATE : See final answer code in the last code block below.* Currently I am having an issue displaying a collection in a collection view. The collection is a property of an existing model like so (pseudo code) ApplicationVersion { Id: 1, VersionName: "", ApplicationCategories[] } So essentially ApplicationVersion has a property called ApplicationCategories that is a javascript array. Currently when I render the collection view associated with ApplicationCategories nothing is rendered. If I

Turning off div wrap for Backbone.Marionette.ItemView

为君一笑 提交于 2019-12-28 07:59:11
问题 I'm looking at the Angry Cats Backbone/Marionette tutorial posts here http://davidsulc.com/blog/2012/04/15/a-simple-backbone-marionette-tutorial/ http://davidsulc.com/blog/2012/04/22/a-simple-backbone-marionette-tutorial-part-2/ and I came upon the same question/need posted here: Backbone.js turning off wrap by div in render But I can only get that to work for Backbone.Views, not Backbone.Marionette.ItemViews. For example, from the simple backbone marionette tutorial links above, take