marionette

Specify an HTML table's <tbody> element as a region in Marionette for Backbone.js

雨燕双飞 提交于 2019-12-12 08:20:21
问题 Problem Using a Backbone.Marrionette.Layout to present some tabular data. The <tbody> portion of the table is a Backbone.Marionette.Region that is meant to display a Backbone.Marionette.CollectionView. I can not figure out how to do this using Marionette's "Regions" without messing up the table display by inserting an extra HTML element inside the <tbody> element. Example Code The Layout looks like this: Backbone.Marionette.Layout.extend({ template:... regions:{ list_region: '#list-region' }

Backbone Marionette Displaying before fetch complete

浪子不回头ぞ 提交于 2019-12-12 07:19:29
问题 I know i am doing something stupid but my backbone marionette app is giving me template errors that don't make sense. It appears to be rendering a single item before the fetch event happens. _.templateSettings = { interpolate: /\{\{(.+?)\}\}/g }; MyApp = new Backbone.Marionette.Application(); MyApp.addRegions({ TagsRegion: "#tagsHolder" }); MyApp.NoItemsView = Backbone.Marionette.ItemView.extend({ template: "#show-no-items-message-template" }); MyApp.Tag = Backbone.Model.extend({ }); MyApp

Should I put the login view as part of my application? [closed]

左心房为你撑大大i 提交于 2019-12-12 06:45:54
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I'm studying @marionettejs It's a fantastic library. Almost all examples start with the whole application, ie, with all regions, like navbar, content, menu, footer, etc. In my application, I have the initial screen that show the login form where the user need fill to access

Marionette js upgrade 1.x to 2.x breaks my dynamic JQuery UI tab control

↘锁芯ラ 提交于 2019-12-12 04:54:51
问题 After an upgrade from version 1.8.8 to 2.4.1 my dynamic tabs control broke. The new Marionette won't let me do something that the old Marionette would. A JQuery UI tab control expects a certain UI structure. At the core, it essentially wants an unordered list inside a container. Like this: <div id="tabs-container"> <ul id="tabs">//this guy should have li's inside it. They'll become tabs. </ul> <div id="tabs-content"> </div> </div>//end #tabs-container If you call $("tabs-container").tabs() in

Reloading handlebars partial from marionette view loses access to ui object defined for partial template element within parent view

拜拜、爱过 提交于 2019-12-12 02:49:48
问题 By referring the this link; I am reloading the handlebars partial template from marionette view within my application. In my marionette view I have defined ui object as below ui: { updateCarrierRow: ".hook--edit-carrier-row", dispatchEquipment: ".hook--dispatch-equipment", editButton: ".hook--edit-button", trailerText: "#trailer-text", tractorText: "#tractor-text" }, From which trailerText & tractorText variables are referencing the elements from handlebars template loaded within current view

How can I show and hide regions in Marionette.js?

a 夏天 提交于 2019-12-12 02:24:32
问题 I am trying to figure out how to use a router and controller in my Marionette.js application. I am able to start the initial page in my App's start handler, but I can't seem to figure out how to handle other routes. This SPA isn't complex, where I only have three pages for my users. One is a leads table view, a vehicle table view, and a view of a single vehicle. I'm not worried about the single vehicle view until I figure out how this routing works. // my app var App = new Marionette

Backbone router.navigate how to pass dynamic ID

徘徊边缘 提交于 2019-12-12 00:44:24
问题 Using backbone marionette I need to navigate to the following route: 'page/:id': 'page' This is what I have tried so far: success: function (page) { id = page.get('id') router.navigate('page', {trigger: true}); } But I have two problems with above. 1) Router is undefined in my view 2) I cannot find a reference to how I pass the ID How do I resolve this or does marionette have any build in methods? 回答1: You can pass the id just putting it in the url: success: function (page) { id = page.get(

Using customized layouts and variable no of fields with backbone forms

巧了我就是萌 提交于 2019-12-11 23:23:24
问题 I am working on an application in which I am using backbone-forms.js for generating dynamic forms. So at present we are able to generate simple forms having a label and input element like this But actually I have to change the arrangement of the fields.In each row I will be having one label,two input fields. So I wanna ask is it possible to generate forms like this dynamically with backbone forms. Ifwe will use a full customized template then there is no meaning of using this framework. So is

Routes and controllers in Marionette.js

南笙酒味 提交于 2019-12-11 23:14:44
问题 Im new the Marionette.js. Im currently implementing routes and controllers. In my App.js, I have: App.appRouter = new Router({ controller:new AppController() }); I want AppController to initialise other controllers. So I have a GenericController which looks after everything when the hash change is "generic", NewsController which looks after everything when hash changes to "news" etc. I don't want to have all the route functions in one giant controller file. So my AppController looks like:

Use attributes with weird chars in Marionette / underscore template

♀尐吖头ヾ 提交于 2019-12-11 18:23:32
问题 I have a model with attributes names like @id , @type , etc. If I try to use <%= @id %> in a Marionette.ItemView template (with Underscore) I get Uncaught SyntaxError: Unexpected token ILLEGAL Using the syntax ['@id'] does not produce the expected result. Do I have to override the serializeData function? Thanks 回答1: Underscore templates require JavaScript expressions inside <%= ... %> , the compiled template uses with so you can usually reference object properties as though they were