marionette

Populating data from JSON for drop downs

柔情痞子 提交于 2019-12-11 18:13:36
问题 I am receiving JSON from the server which looks like { "accountType": ["Full","Trial"], "states": [ {"state":"AL","stateDescription":"Alabama","featured":"A1"}, {"state":"AK","stateDescription":"Alaska","featured":"B1"} ], "dates":[ {"dateDescription":"Jan","month":1,"year":2008}, {"dateDescription":"Feb","month":2,"year":2008} ] } In the Backbone file I'm doing: define([ 'backbone', 'underscore', 'vent', ], function (Backbone, _, vent) { 'use strict'; return Backbone.Model.extend({ url: {},

How to extend a MarionetteJS module to reduce code duplication

十年热恋 提交于 2019-12-11 12:29:45
问题 I've got a notifications toolbar which is a module. Very similar to the notifications toolbar in the facebook native app. In this toolbar are 3 regions: InvitesRegion RequestsRegion NotificationsRegion Each of these regions contains their own module (InvitesModule, RequestsModule, NotificationsModule). Each, however, has the exact same functionality: Check the server for new (Invites|Requests|Notifications) If found, update the associated region And then a whole bunch of other functions

Backbone.history is not updating in IE 9. Back button broken

余生长醉 提交于 2019-12-11 11:44:46
问题 In our app, we actually have two Backbone SPA applications. The first one is for login, registration and other features for unauthenticated users. The URL for this would be something like http://www.example.com/registration#signin. Once you login, you are redirected to our main Backbone app at http://www.example.com/ui#home. In my main UI app, I am using Backbone.history without pushState. The App file looks something like: define(function (require) { var App = new Marionette.Application();

Using Marionette CollectionView to create multiple views per item

∥☆過路亽.° 提交于 2019-12-11 11:26:05
问题 I have a Marionette.CollectionView that for certain items (models) need to create 2 views to run on the model, can Marionette.CollectionView.buildItemView return 2 views? EDIT : I don't want to create some another WrapperItemView, I already have some solution running right now but I want to make it more standart. I want my code to be look like this, is there a simple way to make it work? buildItemView: function(item){ // create 2 views based on item type return [view1, view2]; }, appendHtml:

Object has no method 'call' when setting Backbone Model from Trigger

本小妞迷上赌 提交于 2019-12-11 10:19:15
问题 So, I just spent about 3 hours trying to debug this nasty thing and I'm at wits end. What I'm trying to do is fairly simple. I'm working with a search query (string) and trying to set a global model with its attributes. However, when I'm moving to a different view, I want the model to clear out these attributes, or of course when they enter a new search query, have the event fire again. I'm trying to use the Backbone Marionette Wreqr / Event Aggregator to manage the events here. I don't know

UnCSS not able to find stylesheet in backbone application

狂风中的少年 提交于 2019-12-11 09:40:02
问题 So my application is much in need of a CSS clean up. I did some research and I came across uncss, which seems like the best option out there so far. A little about my application: It's a backbone.marionette app I use Sass I compile all my assets into public/js/app.js and public/css/main.css using the amazing tool brunch.io I've tried running both the command line tool offered in uncss, and the brunch extension of uncss. But each time I run the process, I get this error: Error: UnCSS: no

Backbone.Marionette nested ItemView either not rendering or rendering “blank” view/template

偶尔善良 提交于 2019-12-11 08:39:58
问题 On navigating to a specific URL, a controller method is fired, which loads an ItemView into one of my application's regions. This ItemView itself (the parent) will contain a handful of child ItemViews, rendering them all when it's rendered itself. Here's the parent ItemView: return Backbone.Marionette.ItemView.extend({ template: Handlebars.compile(template), ui: { textInput01: "#text-input-01" }, events: { // no events yet }, initialize: function() { // no init yet }, onRender: function() {

Marionette LayoutView removed my root HTML element in template

风流意气都作罢 提交于 2019-12-11 08:09:27
问题 This is my template file outerLayout.html: <section id="index-wrapper"> <navigation id="menu">menu1</navigation> <article id="content">main content</article> <footer id="footer">footer</footer> </section> This is my outerLayout.js var $ = require('jquery'); var Backbone = require('backbone'); Backbone.$ = $; var Maronette = require('backbone.marionette'); var compiledTpl = require('./outerLayout.html'); // console.info('compiledTpl({})', compiledTpl({})); console.info('compiledTpl({})',

Marionette Event Aggregator vs Backbone Router

早过忘川 提交于 2019-12-11 07:45:58
问题 I'm pretty new to this world so I need some clarifications on it. Maybe I could be wrong on the subject. So, feel free to correct me. I'm studying how Marionette and Backbone work together. Oh yeah. Marionette gives us extension to Backbone. Really nice stuff. The thing that is not obvious to me is when to use the routing mechanism provided by Backbone and when to use publisher/subscriber pattern by Marionette. Is there any rule of thumb? Here, Where to use event aggregator in backbone

Python selenium failing on same function on 2nd time

时光毁灭记忆、已成空白 提交于 2019-12-11 05:08:25
问题 I am using page object model in unittest. There is a function "screenshot" which is passing in 1 test case but failing in another. It is really strange and since it is passing in 1 test case, i am sure about having all the dependancies. Any help would be appreciated. Code: import ... class Abc(unittest.TestCase): def setUp(self): self.xvfb = Xvfb(width=1280, height=720) self.xvfb.start() self.driver = webdriver.Firefox() self.driver.get(data.baseurl) def test_001_login(self): home_page = home