using fixtures in a different way?
Good morning! due ti the fact, that I get my models by jsonRPC via a php server, my model-functions are overridden: return can.Model.extend( /* @static */ { sequence : 100,...
View ArticleRe : What is the best way to reorderng items in DOM?
Ugly "solution"))) http://jsfiddle.net/GE3yf/31/ and another less ugly but still crappy. http://jsfiddle.net/GE3yf/32/ I wonder if canjs guys could come with a good one.
View ArticleRe : Catching can.view load errors
This is a drawback to how jQuery implements deferreds (I'm assuming you're using jQuery here -- please correct me if otherwise). Callbacks do not cause the deferred chain to fail on a thrown...
View ArticleHow to call view helper after can.Model.List data inserted to DOM
I create a fiddle http://jsfiddle.net/GE3yf/34/ But in helper callback length of '.name' is 0.
View ArticleRe : How to call view helper after can.Model.List data inserted to DOM
Depends on what you are trying to achieve, but if you just want to manipulate the element {{test type}} is on, use the `el` reference instead of searching whole document with `$('.name')`. Example: add...
View ArticleRe : What is the best way to reorderng items in DOM?
http://jsfiddle.net/GE3yf/35/ This is the approach I've taken, and extended to solve similar "listing" problems (user-selectable sort, reverse sorting, pagination, deferred state changes). Another...
View ArticleRe : What is the best way to reorderng items in DOM?
I believe such thing as list sorting (and template updating) should be out of the box.
View ArticleRe : Catching can.view load errors
Thanks for the confirmation @air_hadoken, and yes I am using jQuery Deferred's. This also appears to be the behaviour when stealing a resource and there is an error. In the steal case it can be...
View ArticleIs this a safe strategy for translating can.Map/can.Model attribute names...
I have an unfortunate scenario where I must translate attribute names (coming from a server response) prior to initialization on a Map or Model instance. I settled on this solution below. It works as...
View Articleejs in ejs?
Hi, how do I invoke an .ejs-file from another one? Formerly I did this: <%== $.View('//myapp/viewtemplates/myremplate')%> which should be <%== can.view('//myapp/viewtemplates/myremplate')%>...
View ArticleRe : ejs in ejs?
`can.view(path)` returns a render function. I think it depends on the exact CanJS version but you either want: <%== can.view('//myapp/viewtemplates/myremplate')(this) %> or <%==...
View ArticleRe : Is this a safe strategy for translating can.Map/can.Model attribute...
Use can.Model (extends can.Map to support a backend API) and then put your translate logic in can.Model.parseModel .
View ArticleRe : ejs in ejs?
Use can.view.render Sent from my iPhone On Jul 30, 2014, at 8:22 AM, JavaScriptMVC Forum <noreply@zohodiscussions.com> wrote:
View ArticleRe : Is this a safe strategy for translating can.Map/can.Model attribute...
I already tried this suggestion and had a number of issues with parseModel. The biggest being that it seems to only apply to the CRUD methods of a model, and not when you instantiate one directly with...
View ArticleRe : Is this a safe strategy for translating can.Map/can.Model attribute...
Why would you instantiate directly with the incorrect attributes?
View ArticleRe : ejs in ejs?
thanks, can.view.render() works. While I am restructuring my app, it would be an idea, to switch to mustache / stache. (btw. which one? I did read, that mustache is deprecated as well?) I there a...
View ArticleRe : Is this a safe strategy for translating can.Map/can.Model attribute...
I wouldn't instantiate directly (my tests case was simply to show why parseModel didn't work). I would likely be instantiating via can.List.Map or can.Map.prototype.define instead. Let me paint a...
View ArticleRe : Is this a safe strategy for translating can.Map/can.Model attribute...
Haven't tried this but I think you should be able to do this: define: { products: { type: Product.parseModels } } It should cast to Product.List and use your translate logic in parseModel...
View ArticleRe : Is this a safe strategy for translating can.Map/can.Model attribute...
Doesn't seem to work, unless you need to define parseModels explicitly (I was under the impression that it used parseModel for each item by default). http://jsbin.com/yosijare/1/edit?js,console,output
View ArticleRe : binding problem data-picker / mustache / can-value
Thanks Cherif, for your reply. In the meantime we have solved the problem by using a view helper. We put the follwing lines into it: can.$(el).datepicker({ dateFormat: format, onSelect: function (date)...
View Article