Questions tagged [backbone.js]

Backbone.js stands as a distinctive JavaScript framework that encompasses a RESTful JSON interface, firmly grounded on the innovative model-view-presenter (MVP) design paradigm for application development.

Monitoring the progress of file uploads within itemView

In the process of developing an application using Marionette/Backbone, I have successfully implemented file uploads over an AJAX call. Now, I am looking for a way to provide users with feedback on when they can select the uploaded file and proceed with mod ...

How can we leverage jQuery deferred within Backbone Marionette composite views, where each items view contains a form, to execute a task after each form submission is successful?

I am utilizing a Backbone Marionette composite view in which each child item view contains its own form. var DependentsFormFields = Backbone.Marionette.CompositeView.extend({ template: 'dependents_form_fields_wrapper', itemViewContainer: '#depende ...

What could be causing the RTCPeerConnection icegatheringstatechange to not function properly?

I have been trying to utilize the icegatheringstatechange event handler, but it doesn't seem to be functioning properly. Is there a different method I can use to monitor changes in icegatheringstate? How can I determine when all ice candidates have been ...

Refresh the click event on a newly added element in the backbone framework

As a newcomer to backbone.js and using CodeIgniter as my PHP Framework, I encountered a challenge while developing an existing system that uses a backbone.js library. The problem is straightforward if approached with jQuery, but due to the use of backbone ...

Is it possible to use multiple AJAX requests to automatically fill out form fields?

In my Backbone.js web application, there is a form with multiple dropdowns that need to be populated with data fetched from an API. Since all the application logic resides on the client side due to using Backbone.js, I want to avoid populating these dropd ...

Contrast between the act of passing arguments and using apply with arguments

I have an important backbone collection that utilizes a save mixin to perform Bulk save operations (as Backbone does not natively support this feature). // Example usage of Cars collection define([ 'Car', 'BulkSave' ], function(Car ...

Examining the process through which an element attains focus

Scenario I am working on a Backbone application that has an event listener set up for focus events on a textarea. Since Backbone relies on jQuery events, my main concern revolves around jQuery focus events. Inquiry Is there a method to determine how an e ...

Are the sorting algorithms for BackboneJS and AngularJS considered stable sorting methods?

I'm considering incorporating BackboneJS and AngularJS into my app. However, I'm curious about the stability of sorting algorithms in these frameworks. Specifically, I would like to know if they maintain the order of previously sorted columns wit ...

What could be the reason my Backbone view is failing to render?

Can anyone help me troubleshoot why this template isn't rendering properly in my backbone views? Any insights would be greatly appreciated! Below, I've included the code from my jade file for the views and the main.js file for the backbone js script. Jade ...

Node Express functioned as a pushState-enabled server, capable of serving any static resource without the need for a path

I am in the process of creating a one-page web application using either Ember.js or Backbone.js for the front end MVC, and express.js (node.js) as the back end server. server/app.js code snippet: app.use(bodyParser.json()); app.use(express.static(path.j ...

Is my implementation of Model and Views in backbone.js accurate?

I'm new to backbone.js and I've just created my first page. I'm curious to know if I'm headed in the right direction with my approach (if there even is a "correct" way in software development). Is there a way to automatically bind model properties (attrib ...

The Backbone.js model attribute is mysteriously coming back as undefined, even though everything seems to be set correctly when

After experimenting with backbone for a few days, I seem to be struggling with understanding the sequence in which backbone ultimately assigns an attribute within a model. Below is the code snippet that I am working with: Contained in a model.js file - S ...

Guide on displaying multiple views along with their respective models fetched through AJAX in Backbone

Hey there! I'm currently working on painting a screen with multiple models and associated views in backbone. To achieve this, I have separate ajax calls to fetch data for these views. Initially, I thought using the jQuery function $when(ajaxcall1, ajaxcall ...

Backbone sorting is specifically designed for organizing views within the framework

As I work on creating a sorting function in backbone, I have come across recommendations to use views to listen for changes in collections and then render the views once the collections are sorted. However, this approach does not suit my needs for two main ...

Introducing a fresh Backbone object attribute that points to an existing instance property

While working with Backbone/Marionette, I came across something unusual. When I create a new instance of a view with a new collection property and then create another instance of the same view, it seems that the collection property of the second view point ...

When utilizing jQuery.Mockjax to simulate the JSON data, the Backbone.Collection.fetch() function consistently results in a 404 error

My setup is pretty straightforward: Main.js: (function($) { "use strict"; var Company = Backbone.Model.extend({ defaults: { title: "", description: "" }, initialize: function() { ...

Express.js Res redirection problem occurring with Backbone.js due to failure in redirecting hashtag URLs

Issue Summary: Having trouble with Express.js redirect functionality. The problem occurs when trying to redirect after entering /#impulse, but works fine with /impulse/. Server processes the request for /#impulse before applying redirect checks, which re ...

Verify if the backgrid cell has been modified

I am currently working on a custom cell editor and I'm looking for another way to check if a cell has been edited. Below is the code snippet I am using: Backgrid.CustomDateCell = Backgrid.DateCell.extend({ editor: Backgrid.InputCellEditor.extend( ...

Is it possible to achieve Ajax file/image uploading using tastypie, backbone, and knockout together?

I'm struggling with incorporating file/image uploads using tastypie, backbone, and knockout [knockout] I'm not sure how to specify the data-bind for the input field to enable file uploads: // current implementation <input type="file" data-bind="value: ...

Ways to define properties in backbone entities

As I work on my app using backbone, I'm encountering a challenge that might be due to a misunderstanding on my part. I am trying to set specific attributes like titles while also having default values in place. However, it seems that the custom attri ...

Tips for displaying a loading spinner during the rendering of a backbone view

I'm looking for some assistance in rendering a Backbone view that contains a large amount of information. Ideally, I would like to incorporate an animation (spinner) while the information is being rendered. Can anyone offer guidance or help with this ...

The occurrence of events for a basic model in Backbone is inexplicably non

I attempted to save some model data on localStorage (and even tried to catch this event and log some text to the console), but it didn't work - no errors and no events either. Here is my JavaScript code: var app = { debug: true, log: function( ...

Ways to verify the occurrence of a successful event following the execution of a save() operation on a model

Below is the snippet of code I am using to store extra properties in a model (specifically, the answer model) selectMedia: => # Post media to server @options.answer.id = @options.answer.get('_id') @options.answer.url = "/v1/answers/#{@o ...

The success method for fetching data fails to trigger, instead displaying only a 'parsererror' message, despite the browser actually receiving the data

There are two collections in my code, BlueCollection and RedCollection. BlueCollection works perfectly fine as it loads data from an array stored in a variable. However, RedCollection is encountering some problems while fetching data from a different array ...

The problem of asynchronous communication in Ajax

Currently, I am in the process of developing a mobile application using backbone.js. The main functionality of the app involves users selecting football players for a team. To enhance user experience, I aim to implement a feature that remembers player sele ...

Retrieving values from res.send in Jade Template

Having recently delved into the world of node.js and Jade, I've been teaching myself through tutorials on udemy. However, I'm facing some challenges when trying to integrate Jade, Express, and Backbone based on an example. I attempted to use res. ...

Hiccup: encountering ENOTFOUND in nodejs when making a get request

Running a web server on node, here is the code: var restify = require('restify'); var server = restify.createServer(); var quotes = [ { author : 'Audrey Hepburn', text : "Nothing is impossible, the word itself says 'I'm p ...

What is the process for compressing responses with Gzip using require.js in node.js?

I have a regular Express.js app where I am utilizing app.use(express.compress()) to compress gzip responses. When I navigate to regular view pages in Node.js, they all appear to be served using gzip in the browser. However, when I visit the page with th ...

Change the code from a for-loop to use the Array#map method

I have been working on a simple JavaScript function and attempting to convert the code from using a for-loop to Array#map. I'm sharing my code in the following fiddle as I am currently learning about array map: http://jsfiddle.net/newtdms2/. function do ...

Retrieve information about the clicked item using the Backbone framework

I have a unique webpage that showcases an impressive collection of books. Each book listed on the page comes with essential information such as the title, price, and description. This data is imported from a JSON file. Excitingly, when users click on any ...

Error in displaying source and target arrowheads while using the Manhattan router with jointJS/Rappid

Is there a way to ensure that a specific cell is always positioned to the back, allowing for a graph to be placed on top of it seamlessly? When using the Manhattan router, I have noticed that the source and target arrowheads do not display correctly in thi ...

The never-ending loading problem at the bottom of the Firefox screen seems

I am facing an issue while trying to open something in Firefox using window.open(). The loading screen seems to never stop, and I cannot pinpoint the reason behind it. Any advice on how to resolve this would be greatly appreciated. View Screenshot: This ...

The versatility of reusable Backbone components

As I search for the best way to ensure the reusability of Backbone views, I have come across various solutions but am unsure which one would best meet my needs. My goal is to create multiple widgets populated with real-time data and I require a base compon ...

Avoiding Backbone Routing Conflicts when Implementing CSS3 Targeting

I have implemented a CSS target to create some basic animation in my Backbone project. However, I am facing an issue where the method I am currently using adds a #banner to the URL, which Backbone tries to interpret as a route if users refresh the page aft ...

Traversing a series of HTML form elements in order to extract their current values and store them in an object

Suppose we have an HTML structure like this: <nav data-filters class=""> <input type="radio" name="type" value="company" checked>Company <input type="radio" name="type" value="product">Product <input type=" ...

Utilizing BackboneJS to Handle Multiple Collections within a Single View

In my leftMenu section, I am looking to display four menus that are categorized by subject. Each menu is a list, and I want them all to be displayed in the same View. To achieve this, I have created four JSON files, each with its own Collection and Model. ...

Using Backbone for the front end and Node.js for the backend, this website combines powerful technologies

Currently, I am in the process of developing a new website that will function as a single-page application featuring dialog/modal windows. My intention is to utilize Backbone for the frontend and establish communication with the backend through ajax/webs ...

Clear out a collection in backbone.js

I am looking to clear out a collection by removing each item in sequence. this.nodes.each(function(node){ this.nodes.remove(node); }, this); The current method is ineffective as the collection length changes with each removal. Utilizing a temporary arr ...

Tips for displaying an edit action icon when hovering over specific text

Looking for a way to display or hide the edit icon when hovering over specific text? Take a look at this snippet of HTML code: <ul> <li> <a id="pop" href="javascript:;;" data-content="test Desc" data-id="123"> &l ...

Mustache.js integrated with backbone.js failing to render content in the desired div location

Currently, I am utilizing backbone.js alongside Mustache as my template engine. Within one of my backbone views, there are various functions in play, with one specifically responsible for rendering a drop-down list populated with items retrieved from a dat ...

Decipher deeply embedded JSON data into Backbone collections

Hey there, I'm new to using Backbone and have encountered a little hiccup. I've set up my application with nice RESTful routes. Most of my GET requests return individual collections of models, but for one request, I get nested relational data tha ...

Remove all stored data from localStorage and update the view in Backbone framework

Hi, currently I am using backbone localstorage and facing an issue where I need to clear the localstorage every time a user hits the search button. This will allow me to add new data to the localStorage without any conflicts. Additionally, I am attempting ...

Retrieving the value of a child in JSON

I have encountered this JSON structure and I am interested in extracting the value of "resource_uri" which is "/api/v1/client/2/". My implementation revolves around Backbone/javascript. Unfortunately, using json['resource_uri'] does not produce the desir ...

Evaluating TypeError in CoffeeScript using Jasmine with Backbone.js

Currently, I am following the PeepCode video tutorial on Backbone.js, but I am rewriting all the code in CoffeeScript instead of plain JavaScript. Everything is going well so far, except when I attempt to run Jasmine tests on the code, I encounter some Ty ...

What is the procedure for utilizing the comparator to arrange items according to various attributes?

I am trying to find a way to arrange my models in a collection based on their required flag and then alphabetically by their value. This is what my current code looks like: var myModel = Backbone.Model.extend({ defaults: { required: true, ...

What are the best scenarios for implementing jQuery-ui plugin as opposed to Backbone View?

I am feeling uncertain about the concept of "componentization" in web UI development. When I need a component, should I develop my own jQuery-UI plugin or opt for creating a MarionetteComponent if I am using Backbone.Marionette? Both options provide reusa ...

Is there a way to prevent Backbone.js from deleting surrounding elements with 'default' values?

Trying to articulate this question is a challenge, so please let me know if further clarification is needed. As I am new to backbone.js, my inquiry may seem basic. My goal is to utilize backbone to efficiently generate graphs using the highcharts library. ...

Backbone.js: Navigating the Default Path Issue

I've embarked on creating my very first BB app. Progress is decent, but I've hit a roadblock. My router implementation appears as follows: var PlayersAppRouter = Backbone.Router.extend({ routes: { '': 'index', }, initialize: function ...

Generating a primary XML element encompassing multiple namespaces

I am currently working on integrating Restful services with Backbone.js framework. In this project, I need to send XML data and add multiple namespaces to it. Here is the snippet of my current JavaScript code: var mainNamespace = "xmlns='http://services. ...

"Embracing Micro-frontends: Building dynamic web applications using a variety of frontend

I am currently facing a software architecture dilemma. My extensive monolithic web application is built using PHP and backbone js, but I am eager to integrate a new front-end framework like react/vue. The question arises about the best approach to tackle t ...

Navigating using Backbone Marionette URL to Server Endpoint

I need to implement client-side validation to check if the user is logged in, and if not, redirect them to the sign-in page. The issue is that the sign-in page exists outside of my Backbone Marionette app. Is there a way in Marionette, Backbone, jQuery, or ...

Confirming the user's login status using AJAX on the front-end

Currently facing the following issue: I am working on a Rails (version 3.2.8) application that utilizes devise for authentication. The backend is a RESTful API while the front-end consists of a backbone one-page app. Although I have successfully implemen ...

Why is the validate function not being executed in the Backbone Model?

I am a beginner in learning Backbone and I am attempting to implement simple validation in my Person Model. However, I am facing an issue where the validate method does not run when I set a new age. Can someone guide me on where I might be making a mistake ...

Tips for retrieving JSON data using Backbone.js

I'm experimenting with using backbones.js fetch to retrieve json from a twitter search and I need some help figuring out what's wrong with my code below. Can someone lend me a hand? (function($){ var Item = Backbone.Model.extend(); var List = Backb ...

Once the save operation is finished, I retrieve the collection from the server. However, since the fetch is asynchronous, the view is rendered before the fetch is fully complete

When making a fetch call on a collection, I then perform another fetch inside the success methods to retrieve a separate collection. Once both collections have been obtained, I combine them and render them to the view. However, after saving a new item in ...

Browserify is unable to locate the 'jquery' module

While attempting to package my app with browserify, I encountered the following error message: Cannot find module 'jquery' from '/home/test/node_modules/backbone' I have searched for solutions to this issue, but none of them seem to ...

Click to remove the ellipsis from the backbone

Some Background Info I am working on creating a feed similar to Twitter where each row expands on click to show more information. The data is fetched from a JSON file sent from the backend to the frontend, and I am using Backbone.js for rendering. My fee ...

Steps for adding a view to an element

Can someone help me with the syntax needed to append my template within the div "#draggableContainers"? I feel like I'm overlooking something simple. <html xmlns="http://www.w3.org/1999/xhtml"> New Page Title <script src="https://ajax.goog ...

The Colorbox feature showcases images in their binary data format

I'm currently experimenting with using Colorbox to enhance a website that is being built with Backbone.js. Within my code, I have a straightforward image tag set up like this: <a class="gallery" href="/document/123"><img class="attachment-pr ...

Express/NodeJS encountering a CORS problem, causing services to be inaccessible in Internet Explorer

Currently, I am working on a REST-based service implemented in Express/NodeJS. The code includes CORS (Cross Origin Resource Sharing) implementation to allow services to be consumed from browsers like Chrome and Firefox. However, there seems to be an issue ...

Redux sub-application in React

Is it possible to incorporate a sub application within my backbone application using react redux? The purpose would be to have a small number of pages, mainly to test out the concept. ...

Is the model.save() function designed to receive the complete updated JSON response from the server?

There are around 20 attributes available for updating in my model through an HTML form. Upon clicking "Submit", I determine which fields have changed, serialize only those into a data variable, and then execute model.save(data). If the operation is success ...

Utilizing node.js and sockets in my backbone application: a comprehensive guide

I have a question that I believe is fairly simple to answer. My node.js server is installed at /usr/local/bin/node The index.html and server.js files are located at /usr/local/bin When I run node, everything works fine. I have a chat application runni ...

What is the best approach for designing the architecture of a server-side node.js application?

Can you recommend a suitable architecture or pattern for building server-side applications using node.js? For the front-end, I plan on implementing a backbone.js MVC framework and utilizing websockets for communication. If you could provide some examples ...

What emerging patterns can be observed in the security of client-side coding within the realm of web development

Keeping up with the constant flow of new frameworks and technologies can be overwhelming. One area that particularly interests me is client-side frameworks, such as AngularJS, Backbone, Knockout, jsviews, knockback, SPA... These are currently among the mos ...

Node.js - Error: Undefined:0 SyntaxEncountered an unexpected end of input syntax error

Exploring Node.js and Backbone.js for the first time. Using the book "Backbone Blueprints" but encountering issues with the provided code to set up the webserver. Node.js is installed and running fine. Here's the package.json code: { "name": "simp ...

Having trouble uploading files to tastypie using Backbone?

After reviewing some other questions, I believe my tastypie resource needs to be structured like this: class MultipartResource(object): def deserialize(self, request, data, format=None): if not format: format = request.META.get('CO ...

View is unable to trigger the success attribute

Currently, I am delving deep into Backbone JS and facing an issue where the 'success' function in 'EditUser' is not being triggered. I would greatly appreciate it if someone could guide me on what changes I need to make in the code? B ...

Accessing view, model, or collection property in AJAX 'beforeSend' with Backbone.js

Currently in my node application I am utilizing Backbone.js to handle various ajax calls from views, models and collections. To keep track of these calls, I have created a custom property named "myName" in each view, model and collection, with a unique v ...

When dynamically adding input fields in Bootstrap, there is a smaller gap between inline inputs

When adding a new list item dynamically in a modal using jQuery append, the spacing in the first li element seems to have a larger gap between the input fields compared to the rest that are added later. Even after checking the developer tools and confirmin ...

Is it possible to use a Backbone Model for an unconventional HTTP POST request that isn't

After going through the documentation at and , I tried to make an HTTP POST request to fetch some JSON data for my model. However, due to the services not being RESTful, I ended up using a POST request instead of a GET request. The code snippet I have co ...

The backbone view is having trouble processing the data from this.model.toJSON()

I've been working on a Backbone code implementation to display all modifications before adding data to my model. However, every time I try to add something from my form, my view returns "this.model.toJSON() is not a function" and I can't figure out what's ...

I'm all set to launch my express js application! What are the major security concerns that I need to keep in

As a beginner in deploying express applications, I find myself lacking in knowledge about the essential security measures that need to be taken before launching a web application. Here are some key points regarding my website: 1) It is a simple website ...

Ways to ascertain if a view has completed rendering in JavaScript

I am currently building my application using the awesome backbone.js framework. Within my code, I have this layoutView that handles rendering the overall layout and also includes a smaller profile section. The dilemma I'm facing is with the timing of the ...

Events in the backbone view fail to trigger after a re-render

For some reason, I am struggling to get mouse events to work on my backbone view after it is re-rendered. It seems like the only solution is to use a rather convoluted jQuery statement: $("a").die().unbind().live("mousedown",this.switchtabs); I initially ...