marionette

how to load html file in Marionette .js + backbone?

对着背影说爱祢 提交于 2019-12-20 03:53:12
问题 I have one "test.html" in that I have this contend (whole html file have this contend). <h1>First page</h1> I need to load that contend in my div having id ="contend" using Marionette .js <div id="contend"> </div> could you please tell me how I will do that ? fiddle : http://jsfiddle.net/JQu5Q/16/ $(document).ready(function(){ var ContactManager = new Marionette.Application(); ContactManager.addRegions({ mainRegion:"#contend" }) ContactManager.on("start", function(){ console.log(

Marionette.js appRouter not firing on app start

廉价感情. 提交于 2019-12-20 02:57:21
问题 I am currently integrating Marionette into an existing Backbone application. I have an existing Backbone router in place, but am trying to implement a Marionette.AppRouter to take its place. The problem is that on a "Hard Refresh" on the url that the new Marionette router should pick up, it does not fire. If I navigate to another page, then go back to the url that did not fire on a hard refresh, it fires correctly. I cannot figure out why it works after I have navigated to another page and

Render a Marionette region after model has been fetched

与世无争的帅哥 提交于 2019-12-18 16:58:27
问题 I would like to use the approach described by Derick Bailey in " A Generic Problem Solution " in this thread to render a view after a model is fetched. I will report his solution here: MyView = Backbone.View.extend({ initialize: function(){ this.model.on("sync", this.render, this); }, render: function(){ ... } }); myModel = new MyModel({id: someId}); new MyView({ model: myModel }); myModel.fetch(); I have a slightly different situation: my view is inside a region layout. If I call the

Render a Marionette region after model has been fetched

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 16:58:15
问题 I would like to use the approach described by Derick Bailey in " A Generic Problem Solution " in this thread to render a view after a model is fetched. I will report his solution here: MyView = Backbone.View.extend({ initialize: function(){ this.model.on("sync", this.render, this); }, render: function(){ ... } }); myModel = new MyModel({id: someId}); new MyView({ model: myModel }); myModel.fetch(); I have a slightly different situation: my view is inside a region layout. If I call the

backSpace not firing the keyup event in android mobile

佐手、 提交于 2019-12-18 05:55:19
问题 This is the first time,I am working on mobile Apps . keyUp event not firing If I press backspace button. I made a jsFiddle for reference. Initially user entered 23 and then user deleted 3 using backspace button.While entering 23 event firing but while delete time event not firing. I am using device : motorola motog,Android Version:4.4.2 . How can I fix this,can anyone help me with an example code. 回答1: The problem is somewhere Chrome stopped firing keypress events for "backspace" since

Extra wrappers in Backbone and Marionette

依然范特西╮ 提交于 2019-12-17 15:55:16
问题 Using Backbone and Marionette, I've created a new layout that goes into the main content div on my page. The layout looks like this: <div id='dash-sidebar'> <div id='dash-profile'></div> <div id='dash-nav'></div> </div> <div id='dash-content'></div> The issue is that when I render the layout, Backbone automatically wraps it in a div before putting it into the main content div like this: <div id='main-content'> <div> <div id='dash-sidebar'> <div id='dash-profile'></div> <div id='dash-nav'><

Rendering an Array as a List within a Backbone model

夙愿已清 提交于 2019-12-14 02:36:54
问题 This is an extension to another post I found: Backbone: A list of views inside a view I had trouble understanding this (I've never used underscore before) so I figured it's best to post a new topic about this. Scenario I have a model of a group chat which is created and lists a variety of information. This includes a list of the participants in that group chat. I need to display that list as part of the model being rendered. Code Creating the participants array var participants = []; $(iq)

Backbone / Marionette CollectionView - Render inside template?

别说谁变了你拦得住时间么 提交于 2019-12-13 19:53:56
问题 I have a collection rendering well using Backbone/Marionette/Mustache. So PersonModel and PersonView are working fine. PersonView has a mustache template called PersonTemplate that is being loaded perfectly by my PeopleCollection and PeopleCollectionView and rendering inside a default tagname: "div" . However, I want to render this collection inside of another template so I can put some headers there. Right now it's essentially: <div> <!-- collection tagName --> <div class="person"> <!--

Does a CollectionView's childView have to be an ItemView?

半城伤御伤魂 提交于 2019-12-13 19:16:49
问题 I am trying to get a final layout like... Left Column (collectionView) PanelLayout(LayoutView) BannerView (ItemView) ContentView (LayoutView) Section1 (CompositeView) gridRow (ItemView) PanelLayout(LayoutView) BannerView (ItemView) ContentView (LayoutView) Section1 (CompositeView) gridRow (ItemView) but my Left Column (collectionView) does not want to show the panelLayout(LayoutView). Is it possible to have a childView: that is a LayoutView (like the example below) and not a ItemView (http:/

Marionette CompositeView renders itself for each Model in Collection instead of ItemView (Marionette Rails)

假装没事ソ 提交于 2019-12-13 15:10:59
问题 Basically, I'm trying to render a CompositeView as a simple four-column list with a table header, where each model in a collection is rendered into a and appended to the . I'm following an example of Derick's quite closely with only a little variation, but unfortunately have gotten some pretty strange results. Instead of rendering each itemView, the view instead references itself and re-renders for each item in the collection, producing a new table and table head. Before that, It was