Questions tagged [backbone-stickit]

Backbone Stickit is a model-view binding plugin for backbone.

About

Stickit binds attributes to DOM-elements of and vice versa. That means it enables two-way Model-View-Binding. It listens to to

  1. Update the model whenever a binded DOM-element changes (e.g. the value of an input changes due to user interaction).
  2. Update DOM-elements belonging to a view whenever a binded model attribute changes (e.g. due to a new call to model.fetch() or because model.set('someAttribute', someValue) is called directly).

Resources

36 questions
7
votes
4 answers

Backbone Validation with Backbone stickit - All attributes being validated when one is changed

I am attempting to use Backbone Validation with Backbone Stickit, I wish to validate one attribute at a time as the user enters them. However, when a user enters a value all attributes on the model get validated instead of just the one the user has…
Francium123
  • 451
  • 5
  • 19
4
votes
2 answers

Does backbone.stickit support autofill?

I have a problem with binding a simple login form to a model. The "autofill" event won't be recognized by stickit and therefore the view is not in sync with the model. The html is pretty straight forward:
DonAgo
  • 61
  • 4
4
votes
2 answers

Stickit: How to trigger a change event after every model -> view change

I have many events bound to elements in my view, though when I use stickit js to change values in my view by altering the model it doesn't trigger an onChange event. Is there a way that I can trigger an onchange event for the current model:element…
ivory
  • 63
  • 1
  • 5
3
votes
1 answer

Backbone Stickit input value change from outside

I have a datepicker that sets a date on an input. I am binding it with stickit. The problem is that since the datepicker (and not a keystroke) changes the value of the input, the stickit binding doesn't observe the change. If I enter the date…
I Stand With Russia
  • 6,254
  • 8
  • 39
  • 67
3
votes
2 answers

Using visible in combination with onGet in Backbone Stickit

I have a view with a list of data, and I use backbone stickit for model binding. If data is not available I don't want to display the list element, but if data is available I need to format it, thus I've tried the following binding: '.emailItem': { …
Jørgen
  • 8,820
  • 9
  • 47
  • 67
2
votes
1 answer

Why resetting a form does not clear the bound model attributes

I have bound the text inputs in a form to a Backbone Model using backbone-stickit bindings: bindings: { '#txtRemarks': 'remarks', '#txtFromAccountNumber': 'account_no', '#fileChooser':'fileChooser' } When I reset the form, the values in…
M Hari
  • 113
  • 2
  • 10
2
votes
1 answer

Weird Backbone.Validation bug when used with require.js and backbone.stickit

I amusing T. Hedersen's backbone.validation plugin (https://github.com/thedersen/backbone.validation) in conjunction with backbone.stickit plugin for model binding. I am running into a weird error where in it constantly validates all the fields when…
2
votes
1 answer

backbone.js nested object attribute with stickit.js

I am using stickit.js to achieve two way data binding. I am please to know how do I bind stickit with nested object attribute. For an E.g. var Person = Backbone.Model.extend({ defaults:{ name: { first: 'James', …
fernando
  • 707
  • 8
  • 24
2
votes
1 answer

Set global setOptions for Backbone.Stickit.js bindings

Is there any way of setting global setOptions for Backbone.Stickit.js? That way I can avoid having to set validate: true as well as other custom options on every binding: bindings = { '.someEl': { observe: 'prop1' , setOptions:…
gxc
  • 4,946
  • 6
  • 37
  • 55
1
vote
1 answer

How to bind length from a backbone.Collection using StickIt?

Using Backbone, Marionette (1.8.3), StickIt and TypeScript. How could I bind the lenght of a Backobone collection so that it gets update whenever items are added to or removed from the collection? I'm quite new to StickIt and here what I have tried…
TTT
  • 1,848
  • 2
  • 30
  • 60
1
vote
1 answer

(Re)rendering Backbone view in change event handler does not work

I'm having two form elements, both 2-way-databinded via backbone.stickit. The second form element (#input) is just cosmetics - there for showing it's actually working. The idea is that my View gets (re)rendered,every time the option inside the…
1
vote
0 answers

Undefined object in Stickit/Backbone model after selecting result from Select2 Ajax

Here is the jsfiddle , I have used almost the same fiddle My Fiddle with Ajax and here is Matt's Stickit MultiSelect Select2 with an array but added an ajax attribute to the select config. Clicking on the Result, the model sets an undefined…
1
vote
2 answers

OptionGroup in select binded with stickit

I use Backbone.stickit, Backbone.marionette and Backbone on the client side for an edition page. One of the fields of my model is picked up from a dropdown (