Tagged Questions
19
votes
6answers
3k views
Testing backbone.js application with jasmine - how to test model bindings on a view?
I had some interesting tribulations in trying to test whether views were correctly bound to events. In backbone, we typically bind to events in the initialize method, using something along the lines ...
10
votes
7answers
4k views
calling javascript on rendering views in BackBone js. post-render callback?
behold, a backbone view render call:
render: function() {
$(this.el).html(this.template({title: 'test'})); //#1
this.renderScatterChart();
return this;
},
so, I call a standard render at #1. ...
6
votes
6answers
7k views
How to pass a javascript variable into a erb code in a js view?
I have this Javascript view in my Rails 3 project:
app/views/expenses/new_daily.js.erb
var i = parseInt($('#daily').attr('data-num')) + 1;
//$('#daily').append('agrego fila ' + i + ' <br />');
...
6
votes
3answers
4k views
backbone.js view inheritence. `this` resolution in parent
I have a case that uses view inheritence, and my code looks essentially like:
parentView = Backbone.View.extend({
events: {
"some event": "business"
},
initialize: function(){
...
8
votes
4answers
1k views
Backbone: Are Views really Controllers?
I'm building my first Backbone.js app and I'm confused about how much responsibility I'm supposed to give to or hide from my Views.
In my example, I'm building a Rich UI Table (similar to YUI's ...
5
votes
2answers
1k views
Can i give the view a show up animation in emberjs
Here is a example using emberjs router http://jsbin.com/agameq/edit.
Now I wanna have some showup animation, like fadeIn or fadeOut, when route changed. what should I do?
0
votes
1answer
2k views
How to make a respond_to by AJAX in Rails 3?
I have a form, that I send with using AJAX. The form is in the FirstsController. I need the form send to SecondsController. The form is sent and data saved. Then I wanna change the form by a text, I ...
1
vote
1answer
72 views
Render Multiple View/Controller Pairs
I am currently rendering a list of views:
<ul>
{{#each newsItem in controller}}
{{view App.NewsItemView contentBinding="newsItem" class="news-item" }}
{{/each}}
</ul>
...
1
vote
4answers
3k views
Backbone View Inheritance
I am trying to write a Backbone view for an object browser which is designed to be implemented in several places with different object types and slightly different operation. How can I achieve some ...