marionette

keyPress event not firing in Android mobile

痴心易碎 提交于 2019-12-03 18:01:39
问题 I am using backbone,marionette for my Application.I used same code for both desktop and mobile but keypress not working in mobile .I made a Jsfiddle for testing. If you open this link in mobile event not firing,If you open in desktop it's firing.How can I resolve this. can anyone help me. Thanks. 回答1: Chrome mobile doesn't support keypress events properly for now. There is a long standing bug for this: https://code.google.com/p/chromium/issues/detail?id=118639 I believe it should be fixed in

How to add a custom delete option for backgrid rows

帅比萌擦擦* 提交于 2019-12-03 16:59:04
问题 i have developed editable grid using backgrid and it looks good also. following is my output : when i select the check box and click on delete icon, then the selected rows are deleted. now i also would like to have the delete option on each row so that the user can delete the row directly. How to put delete icon on each row.?? 回答1: You can make a custom cell. var DeleteCell = Backgrid.Cell.extend({ template: _.template(" PUT YOUR HTML BUTTON TEMPLATE HERE "), events: { "click": "deleteRow" },

How to attach Backbone.Marionette view to existing element without creating extra element

我只是一个虾纸丫 提交于 2019-12-03 16:14:23
Say I have these two Backbone.Marionette views: var FooView = Backbone.Marionette.ItemView.extend({ tagName: p, id: 'foo', template: this.templates.summary }); var BarView = Backbone.Marionette.ItemView.extend({ template: this.templates.summary }); And then I want to show them inside an app region, like so: App.contentRegion.show(new FooView/BarView()); The first view would create a new element and append it to the region. I thought the second way would be more like a standard Backbone view and attach itself to the region without creating a new element, but it wraps it in a tag. Is there a way

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

 ̄綄美尐妖づ 提交于 2019-12-03 15:07:09
* 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 debug in Chrome's javascript debugger it appears that the categories have not been populated yet (so I

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

徘徊边缘 提交于 2019-12-03 14:38:07
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 () { // do something here after rendering *all* groupDetailRows of information for group detail section

Routing in Backbone.js / Marionette.js - no hashtags, route list and sub-routers

最后都变了- 提交于 2019-12-03 13:54:50
问题 I have three questions about routing in Backbone.js / Marionette.js : 1) How can I get a list of all the routes my application's routers have registered ? For example for Express.js (in Node.js) it would be app.routes . I'm trying to do the same with Backbone.js / Marionette.js but couldn't find any property or method that did this. 2) I want to clean-up my URLs and remove the hashtag "#" in front of them, I know that they trigger the Routers so how can I manage to do this ? I found the

How to define/use several routings using backbone and requirejs

為{幸葍}努か 提交于 2019-12-03 13:13:41
问题 I divided my app in several apps. main.js app.js app1/ |- routing |- controller |- app app2/ |- routing |- controller |- app 1) When I try to use the routers in app1 , they work. 2) When I try to use the routers in app2 , they don't work. 3) If I comment the line 'js/app1/routing', in main.js the routers in app2 work. Why do I get this behaviour? Is there some example of app using multiple routing and requirejs on github? thanks. Here's my code: ** main.js ** define([ 'js/app', 'js/app1

Two Collections inside a Composite View

佐手、 提交于 2019-12-03 12:55:54
问题 So we are working on a project using marionette and we have made a good progress so far, but we struggling with a part of the marionette nested view model, so lets assume that we have an apartment (represented as a composite view), and the apartment contains a collection of rooms and a collection of chairs, what we want to do is have the rooms and chairs a direct descending of the aprtment composite view, how can we do this, knowing that the composite view can only have one child collection,

Dynamically add regions to Marionette layout

依然范特西╮ 提交于 2019-12-03 12:40:45
I have a layout, but cannot define all of its regions in advance because they are not known. So later on an ItemView is created and I'd like to create a new region in the layout using the view's ID as the region's name so I can then say: layout.dynamicRegionName.show(newItemView); But there is cyclic dependency here. I haven't rendered the view yet, so I cannot make a reference to its DOM element to be used in the layout's call to .addRegion() I cannot render it, precisely because I want it to get attached to the DOM tree through the dynamically added region by calling its .show()

What is the difference between url vs urlRoot

佐手、 提交于 2019-12-03 09:48:37
I would like to know what is the difference between using url or urlRoot . I have read the documentation ( backbonejs.org/#Model-url ), but I still feel that I lack knowledge in this area and I would like to know more. When do you have to use url ? And in another instance when do you have to use urlRoot ? .urlRoot is only available in a Model, and is only useful when either a model is not part of a collection, or when you want to override the .url property of the collection which that model is part of. In other words, a model doesn't require neither .url nor .urlRoot property when it is part