marionette

Is using the same id multiple times on a page bad practice even when I am not parsing through the page?

大兔子大兔子 提交于 2019-12-01 16:13:48
I understand that using the same id multiple times in a page creates malformed html. When using a jquery selector only the first element with the id will be returned, but in my application I shouldn't be running into this issue. I have list of items views that will all have an element I need to refer to. Since each item only has access to its own $el passing in an id selector for something will not produce any conflicts (even if there are multiple on the page). I've simulated what I mean in a fiddle here In this project I am not doing any page wide parses so I believe it should be safe. Is

Do ItemView triggers bubble up?

倾然丶 夕夏残阳落幕 提交于 2019-12-01 16:08:25
I have a CompositeView for a table. I have triggers set in the child ItemView for each row... var TableRow = Marionette.ItemView.extend({ tagName: "tr", template: _.template($(TableTemplates).filter('#tableRow').html()), triggers: { "click td": "click:td" } }); Are the triggers supposed to bubble up to the parent CompositeView? From the docs ... Having access to these [the view, model, and collection properties of the view that triggered the event] allows more flexibility in handling events from multiple views. For example, a tab control or expand/collapse widget such as a panel bar could

Is using the same id multiple times on a page bad practice even when I am not parsing through the page?

人走茶凉 提交于 2019-12-01 15:19:10
问题 I understand that using the same id multiple times in a page creates malformed html. When using a jquery selector only the first element with the id will be returned, but in my application I shouldn't be running into this issue. I have list of items views that will all have an element I need to refer to. Since each item only has access to its own $el passing in an id selector for something will not produce any conflicts (even if there are multiple on the page). I've simulated what I mean in a

Do ItemView triggers bubble up?

只谈情不闲聊 提交于 2019-12-01 15:13:38
问题 I have a CompositeView for a table. I have triggers set in the child ItemView for each row... var TableRow = Marionette.ItemView.extend({ tagName: "tr", template: _.template($(TableTemplates).filter('#tableRow').html()), triggers: { "click td": "click:td" } }); Are the triggers supposed to bubble up to the parent CompositeView? From the docs... Having access to these [the view, model, and collection properties of the view that triggered the event] allows more flexibility in handling events

How to avoid an extra div in a Backbone Marionette Region or LayoutView

≡放荡痞女 提交于 2019-12-01 11:15:47
we are using Backbone,Marionette and handlebars for my application. When I try to render my view inside Marionette.Region , one extra div wrapping around the template. How can I avoid this. html code : <div id="mainDiv"></div> <script type="text/x-handlebars-template" id="basic"> <div id="first"></div> <div id="second"></div> </script> js code : //function var templateCompilation=function(templateId,data){ var alertCompilation=Handlebars.compile(document.getElementById(templateId).innerHTML); return alertCompilation(data); }; //Application myApp = new Backbone.Marionette.Application(); myApp

How to avoid an extra div in a Backbone Marionette Region or LayoutView

主宰稳场 提交于 2019-12-01 07:35:08
问题 we are using Backbone,Marionette and handlebars for my application. When I try to render my view inside Marionette.Region , one extra div wrapping around the template. How can I avoid this. html code : <div id="mainDiv"></div> <script type="text/x-handlebars-template" id="basic"> <div id="first"></div> <div id="second"></div> </script> js code : //function var templateCompilation=function(templateId,data){ var alertCompilation=Handlebars.compile(document.getElementById(templateId).innerHTML);

bootstrap collapse not working when creating dyanmically

 ̄綄美尐妖づ 提交于 2019-12-01 04:55:28
问题 I am fetching my content via ajax call and creating all the collapsible panel on run time. but toggle functionality is not working in this way. I am using backbone marionette collection and item view for creating my panel-group. I checked with static content and it works fine with static data. I have checked few links but in my case nothing seems to work. How to make Twitter Bootstrap Collapse work on dynamically loaded html using ajax https://github.com/twbs/bootstrap/issues/2274 Here is my

Using jQuery Tabs with Marionette Layouts

瘦欲@ 提交于 2019-12-01 00:24:58
I'm working on trying to use jquery tabs inside of a Marionette region. The HTML for a two tabbed area looks like this: <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> </ul> <div id="tabs-1"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales

Using jQuery Tabs with Marionette Layouts

假装没事ソ 提交于 2019-11-30 18:07:56
问题 I'm working on trying to use jquery tabs inside of a Marionette region. The HTML for a two tabbed area looks like this: <div id="tabs"> <ul> <li><a href="#tabs-1">Nunc tincidunt</a></li> <li><a href="#tabs-2">Proin dolor</a></li> </ul> <div id="tabs-1"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean

Render a Marionette region after model has been fetched

◇◆丶佛笑我妖孽 提交于 2019-11-30 15:18:34
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 Marionette.Region.show() it works but the view is rendered twice. Calling Marionette.Region.attachView() the