Tagged Questions
1
vote
1answer
24 views
backbone.js: different output for same process
Working through the setElement part of Addy Osmani's backbone.js tutorial.
He presents this example:
// We create two DOM elements representing buttons
// which could easily be containers or ...
0
votes
0answers
8 views
Single Page Backbone with YouTube IFrame App
I am building a single page app using backbone and I am having some problems with the youtube iframe api. My app is like an online education app where there are different classes in different pages of ...
1
vote
0answers
12 views
Trying use a Backbone.sync for get data from action controller in Rails - non-restful
I'm really complicated trying get data from Rails controller through my custom @sync
This is my action controller:
class CargasController < ApplicationController
def readExcel
@data = ...
1
vote
1answer
18 views
google maps infowindow doesn't size correctly to fit image when content is set to jQuery object
I am trying to get my backbone view, that represents an infoWindow, to respond to a click event.
App.InfoWindowView = Backbone.View.extend({
events: {
"click a": "clickInfoWindow" // ...
0
votes
1answer
24 views
Uncaught TypeError: Object #<Object> has no method 'bind' - backbone
I am getting the following error : Uncaught TypeError: Object #<Object> has no method 'bind' with backbone.
var UpdatingPostView = PostView.extend({
initialize: function (options) {
...
0
votes
2answers
23 views
Get response headers after backbone fetch is complete
I need to read response headers in an Ajax request made by backbone.js fetch method. is there any way to read headers if I override the fetch method:
var PageCollection = Backbone.Collection.extend({
...
0
votes
1answer
23 views
Scope, losing refernece to an object in a callback
I'm extending a router in backbone -
Zoo.Router = Backbone.Router.extend({
route: function (route, name, callback) {
this._super(route, name, callback); ...
2
votes
1answer
19 views
jQuery Mobile split button clickEvent no ID
I have a list of elements that have split buttons. Each split button got an id. If I catch the click event from the clicked split button, it has no id.
Split Button:
<li><a href="#" ...
0
votes
0answers
32 views
Backbonejs, behavior of this in a View, Uncaught TypeError
Solved? Not quite.
https://github.com/jashkenas/backbone/issues/2822
This is a Cordova + Backbone mobile App. I've been banging my head against this one for a while and thought it was time for some ...
0
votes
1answer
34 views
Backbone localStorage and relations
I'm having two RelationalModels, Student and School. School has many Students. All the data is to be stored in Backbone.localStorage
I need advice how the following should be done:
I suppose I need ...
2
votes
0answers
24 views
Why can't phantomjs chain backbone methods?
I'm using Jasmine to test a backbone app, which works fine in the browser, but when I run it using grunt-contrib-jasmine via phantomjs it chokes on:
var myVar = ...
0
votes
1answer
17 views
Re-creating build environment for Backbone.js source files (amd-app.js)
A new client of mine has come to me with a web site that consists of a Backbone.js app front-end (I think) and a PHP back-end. The front-end is split over multiple javascript files and directories, ...
0
votes
1answer
53 views
JSON object being returned should be array
I am using backbone and my fetch was not returning anything (when I tried to iterate with each), I had a close look and found that it fires a get request and this is what is being returned
{
...
1
vote
0answers
42 views
Fetch returns nothing, model instance is null
Can someone explain to me why my fetch call does not return any data...also my posts model comes up as none..is this normal :/?
$(function() {
//Set firebase URL
var base_url = ...
0
votes
1answer
31 views
Layout inside Layout in Marionette
I have two layouts like:
Layout1 = Marionette.Layout.extend({
template: {
type: 'handlebars',
template: Layout1template
},
regions: {
region1: '#header',
region2: '#content'
}
});
...
0
votes
1answer
39 views
Using HighCharts with Backbone
I have deployed a website using BootStrap UI with Backbone JS for my new website. I want to load an example/demo charts on the page. I did not find tutorials regarding the same. Can someone help me ...
0
votes
1answer
18 views
Backbone.history and file download
I'm creating a Backbone/Marionette app and I'd like to hove a simple link to download a PDF file like localhost/myapp/catalog.pdf. But since I use Backbone.history.start(); the link doesn't work. How ...
0
votes
1answer
23 views
Backbone.js directory structure
New to Javascript/Backbone. I am wondering what's the 'convention' in Backbone when setting up directory structure.
I have a Backbone.js app that has two main 'entry' points. One is Admin ...
0
votes
2answers
27 views
assigning a variable inside the getJSON function
In Backbone & marionette, I'm using json to grab my translations. I'm doing this in my ItemView under the onBeforeRender function. But whenever I call the "this.model.set" function, I always get ...
0
votes
0answers
27 views
localization and translation for backbone.js
I'm trying to figure out how to add localization with backbone.js and marionette. You can see the code in here . I'm stuck as to how to display the translation from the json file to be displayed on ...
1
vote
2answers
22 views
Security for Rails-based javascript apps: How do you verify permissions on a user within rendered javascript?
Apologize if this is the wrong stack for this question. If so, please direct me to the correct site.
I have a rails app, where-in users can be a member of one of three roles: user, admin, or system. ...
0
votes
0answers
25 views
+50
Youtube IFrame API with backbone
I am trying to use the YoutTube's Iframe API in my backbone application, and I am not sure if I have the right approach.
var VideoView = Backbone.Marionette.ItemView.extend({
initialize: ...
0
votes
2answers
27 views
Splitting routers in backbone
I am trying to develop a backbone.js app in a modular fashion using require.js
I want separate router for each module and so want something like "baseURL" in the router:
var ...
0
votes
2answers
27 views
exclude a folder from expressjs routing
On my expressjs app, public assets are loaded in this way:
app.use(express.static(__dirname + '/public'));
And then I redirect all requests to the index, to handle every path with Backbone
...
0
votes
1answer
37 views
How to load only models with a specific attribute value?
for (var i = 1; i <= news.length; i++) {
var newsData = news.get(i);
var newsRow = JST["news/row"](newsData.attributes);
...
0
votes
3answers
36 views
BackboneJS - How to create a “show more” button inside a view
I have a backbone view, which shows a couple of articles/divs. I want to add a "show more" button. My original html looked like this:
<div id="ip">
<article>
...some other ...
0
votes
2answers
24 views
Backbone.js add a computed attribute to model after it's parsed
In Backbone is there a way to execute a function on the model after that same model has been parsed.
I have models with base data, and want to compute another attribute of the combined base data.
...
2
votes
3answers
65 views
What makes Angular and Backbone different from jQuery?
I have been using JavaScript and jQuery for quite a while now and want to extend my skill set further, during my search I came across two popular names Angular and Backbone and while reading about ...
2
votes
2answers
42 views
How to add different classes to template element?
In my JSON file I have 7 objects, where first 3 of them have "is_read" attribute == 1, and last 4 have "is_read" == 0.
I add rows, using a template and want to give tr different classes according to ...
0
votes
1answer
14 views
Support for async template loading with Backbone.js Views?
I'm new to Backbone.js, and trying to wrap my head around the whole thing. We already have a custom template system which we use internally. My issue is that our system requires an async callback to ...
0
votes
0answers
11 views
Backbone Localstorage don't save model
Currently I'm busy with developing my first Backbone webapp, but I've got a problem when I try to edit a model that's in a localStorage collection.
I've put the code online: ...
0
votes
1answer
15 views
User keyboard interaction: a view or an event?
I am working with a Backbone app and I have a 'philosophical' question:
When a certain key is pressed, the user will be taken to another page/view, this is to happen globally across the app, for ...
3
votes
2answers
52 views
handling backbone model/collection changes in react.js
I've been working with facebooks framework React.js together with Backbone for the last couple of weeks and I'm still not entirely sure what is the most appropriate way to re-render a React component ...
5
votes
1answer
48 views
How to specify one attribute of a model inside a collection?
render: function () {
news.fetchMyNews();
for (var i = 1; i <= news.length; i++) {
var newsData = news.get(i);
var newsRow = JST["news/row"](newsData.attributes);
...
0
votes
2answers
29 views
Backbone event firing on click OR press enter
I am new to backbone and I am looking for a way for my button to be triggered when I press enter as well as clicking. Currently showPrompt only executes on a click. What is the cleanest DRYest way to ...
0
votes
1answer
15 views
The proper way of binding Backbone.js async fetch operation results to a view
I am wondering if there are any pointers on the best way of "fetching" and then binding a collection of data to a view within Backbone.js.
I'm populating my collection with the async fetch operation ...
0
votes
2answers
32 views
Can't get a views/collection to show?
I can't seem to get a test backbone.js app working and I have no idea what I am doing wrong.
http://jsbin.com/iwigAtah/1/edit
0
votes
1answer
21 views
Backbone routes with slash before hash redirect
I was wondering what would be the easiest and cleanest way to add slash before hash when page is loaded without one.
Suppose I have a url www.example.com and I have a link which points to ...
0
votes
1answer
60 views
Backbone Marionette Layout Region not closing when returning to module
I have a Backbone Marionette application whose layout's regions are not working properly. My app is structured using Require modules and some of these modules' regions are failing to close themselves ...
1
vote
1answer
52 views
Backbone view in sails .ejs file
I am trying to access backbone views in sails framework. I fetch data from the server and I am trying to push them to the DOM. Actually, I ve created a model-controller for the tags I store data from ...
0
votes
1answer
27 views
Backbone/jQuery mobile duplicate view
I've got some problems with my Backbone, RequireJS & jQuery mobile application.
When I use a form view 2 times the form submit event is fired twice.
Each new view is added to the body and the ...
1
vote
2answers
28 views
Change event triggering on momentjs object
For one of my projects, i'm listening on attribute changes on a model object and calling view methods if its attributes change.
Problem is one of the attribute of my model is a momentjs date object.
...
0
votes
1answer
23 views
backbone.js can't fetch data from url?
I had this working the other day, I don't know what I did differently but I can't fetch the data to add into my collection. From tutorials and the docs this code should work right?
var Player = ...
1
vote
1answer
26 views
Backbone router for two dimensional menu: advice
I am a very beginner in backbone.js.
My page navigation looks like this:
The left navigation defines four view types, while the top navigation should update the datamodel and re-render the ...
-1
votes
1answer
37 views
Backbone Collection.each method affects every second model
I trigger 'removeAll' on collection on click from outside. It looks like that:
Bind inside collection constructor:
$('.empty').click => this.removeAll()
Empty the cart:
removeAll: ->
...
0
votes
1answer
20 views
Firebase Uncaught Reference Error Backbone / Fetch called on a Firebase collection, ignoring.
I am trying to link up backbone with firebase
In the forge I have the following structure laid out:
-myfirebasename
-user
-first_name
-last_name
This code:
var Items = ...
0
votes
1answer
21 views
http://0.0.0.0:4567 is not allowed by Access-Control-Allow-Origin. with Backbone & Firebase
I am using backbone trying to fetch data from firebase, and I am getting this error.
I believe I need to set the header somewhere so that it accepts cross origin requests but I'm not sure how I go ...
0
votes
1answer
44 views
Why do I have to press back twice to go back in Backbone?
Live Demo of the problem
I have this little example app, where I try to implement a routing system with history. It works as excepted, but for some reason I have to press the back button twice. If ...
0
votes
2answers
42 views
Render a View of Backbone Model returns undefined
Lets say i have a JSON like this:
JSON example, my json is validated on jsonlint and it works.
json_object = {
"texts_model": {
"hello": "hola",
"icon_text": "Icon!"
},
"collection_vias": {
"text": ...
0
votes
1answer
37 views
backbone.js - toggle element
I use toggle() for an element. When user clicked a link content slide down and clicked again content slide up.
I use this code for toggle:
var LastItem = Backbone.View.extend({
el: '#item-div',
...