Questions tagged [spine.js]

Spine is a lightweight framework for building JavaScript web applications.

Homepage: http://spinejs.com/

Spine.js Introduction

Spine is a lightweight framework for building JavaScript web applications. Spine gives you an MVC structure and then gets out of your way, allowing you to concentrate on the fun stuff, building awesome web applications.^

Resources

182 questions
0
votes
1 answer

Overriding fetch in multiple spine models

I need to override Spine's @fetch() method in all of my Spine models. Currently I have code duplication as follows: TastypieEndpointMixin = fromJSON: (data) -> return unless data return Spine.Model.fromJSON(data.objects) class…
Adam Charnock
  • 1,596
  • 1
  • 13
  • 17
0
votes
1 answer

Change a controller's class after inside render

According to the documentation each Spine Controller has a className field that add a class to the rendered element. class Users extends Spine.Controller className: "users list" Is it possible to change that after it has been initialized? For…
Panos Spiliotis
  • 801
  • 1
  • 9
  • 18
0
votes
2 answers

Spinejs - how start app when #route is already in url?

I started to refactor some "legacy" code, where a lot of js files are duplicated due to one or two specific parameters for a script. My idea is to merge all files into one, remove code duplication and distinguish those parameters based on routing.…
mrok
  • 2,680
  • 3
  • 27
  • 46
0
votes
1 answer

JSON.stringify missing superclass properties when using a subclass with Spine

I'm seeing strange behaviour using JSON.stringify against a subclassed model in Spine, and I'm hoping someone can help! Here's a simplified excerpt from some code that we've got on one of our projects: define([ "jquery", …
gerrod
  • 6,119
  • 6
  • 33
  • 45
0
votes
2 answers

Limiting Records returned from SpineJS fetch()

I'd like to have some routes in an app I'm writing which limit the number of results returned. Currently I have the following in my main controller: init: function(){ MyModel.bind("refresh", this.proxy(this.addAll)); this.routes({ …
Ian Wootten
  • 141
  • 4
0
votes
1 answer

Spine JS stack routes - undefined params?

I have a basic Spine/coffeescript app and I am trying to get the parameters out of the route that I have set up, by looking at examples of other applications. Here is the basic stack: class Main extends Spine.Stack el: "#main" controllers: …
Andrew Mao
  • 35,740
  • 23
  • 143
  • 224
0
votes
1 answer

spine.js populate model instances at start up

Absolute beginner here. I want to load data into models as soon as the page loads. Before anything else is executed. At the moment I have this code. // Model code var Portfolio =…
Paul Thompson
  • 77
  • 2
  • 5
0
votes
1 answer

Trying to init() Spine's Controller and failing

I'm trying to create a Spine's Controller and init() it, jQuery(function($) { window.Tests = Spine.Controller.create({ init: function() { console.log('Tests created!'); } }); window.App =…
drzhbe
  • 785
  • 1
  • 6
  • 15
0
votes
1 answer

Is it possible to use multiple @configure in spine.js Models?

I would like to know if it's possible to call multiple @configure calls or conditionally inside a spine.js model. This would allow the model to be reused in case where there two different forms that could benefit from using the same model. Is there…
Panos Spiliotis
  • 801
  • 1
  • 9
  • 18
0
votes
1 answer

Can SpineJS block the UI when updating?

One of the stated SpineJS goals is to make the entire UI non-blocking (i.e. display the change to the user, even though it might have not been updated successfully on the server side yet). Can it be used in a standard "blocking" manner?
ipavlic
  • 4,906
  • 10
  • 40
  • 77
0
votes
1 answer

@extend Spine.Model.Ajax.Methods

Look, this works fine: class Page extends Spine.Model @configure "Page", "name" @extend Spine.Model.Ajax but this: class Page extends Spine.Model @configure "Page", "name" @extend Spine.Model.Ajax.Methods @fetch (params) -> index =…
none
  • 1,699
  • 2
  • 13
  • 18
0
votes
1 answer

Using Spine.Model.Ajax, how to handle extra properties in the responsed JSON when model updated

For example: class User extends Spine.Controller @configure 'User', 'name' @extend Spine.Model.Ajax @url: '/save' user = new User(name: 'test') user.save() User.bind 'update', (item) -> console.log(item.flag) # undefined say '/save'…
hulufei
  • 737
  • 1
  • 6
  • 17
0
votes
2 answers

spine.js many to many relationship?

im trying to figure out if spine.js does support many to many relationships between models or if im on the better path implementing something myself by storing the related models id in an array on both sides. examples in the documentation show…
aschmid00
  • 7,038
  • 2
  • 47
  • 66
0
votes
1 answer

Spine.js and two controllers

Immediately declare: not to consider this issue as a real application. Everything is done exclusively for the purpose of self-education and learning spine.js Secondly, I know about the relation. I do not want to use, because world is wider than…
none
  • 1,699
  • 2
  • 13
  • 18
0
votes
1 answer

why should I use backbone.js or spine.js

I'm developing a mostly informational public facing website. My architecture is to deliver JSON data to the client for pages in the site. I plan on caching the JSON in localStorage on client and let it persist there for XX amount of time before it…
Tom Schreck
  • 5,177
  • 12
  • 68
  • 122