Re : can.Model file upload with XMLHttpRequest2 upload
Found this: https://github.com/bitovi/canjs/issues/147Justin says "use trigger like $(obs).trigger(...)" however, jQuery's trigger() automatically passes the first argument of the callback function as...
View ArticleMustache views and deferreds
I wonder if it is possible somehow to render deferred result in mustache view:I tired this:var def = function(){ var def = can.Deferred(); def.resolve('DEF HEADER')...
View ArticleRe : Mustache views and deferreds
I would create an observable and render it via live binding, then change the observable's value when the deferred resolves.
View ArticleModel.List _changed never reset
I see in https://github.com/jupiterjs/jquerymx/blob/master/model/list/list.js that _changed is set on a push and that get() checks changed to determine when to call _makdata. However, I don't see where...
View ArticleAdd customized functions to Model
I just start practicing on canjs. I want to know if I can add my own functions (operations) in a Model. For example, I want to find all employee joined the company after xx date and I want to find all...
View ArticleRe : Add customized functions to Model
You can, but the best way to do this is to pass parameters into a findOne or findAll function call:So:Employee.findAll({ startDate: ...,});Then you would have to configure your back end to do the...
View ArticleRe : Add customized functions to Model
I'll try it. But, does canjs only support REST service? Does it work with Struts 1 or 2?
View ArticleRe : Add customized functions to Model
Out of the box it works with REST, but you can override all of a model's static methods (findAll, findOne, etc) to do whatever you want.
View ArticleRe : Add customized functions to Model
Could you please show me how to override those methods or point me to the sample code somewhere on the internet?Thank you very much!
View ArticleRe : Mustache views and deferreds
Yes I understand this approach but I wonder if mustache view/helpers can work with with can.Deferred in some way.
View ArticleRe : Can.Observable.List too much recursion issue
In case that someone gets the same issue: check the size of the object you add in the list.In my case it was a huge object that when added to the list produced this error.Bye.
View ArticleRe : Add customized functions to Model
That's a great source and I'll practice with that.
View ArticleRe : Mustache views and deferreds
When you pass a Deferred in the can.view data it will wait until it resolves and use the result:can.view('view.mustache', { def: def() });<header>{{def}}</header>
View ArticleStop/Start routing
I have an interesting routing problem.User is at a URL.User "logs out" of application. The URL stays but the applications routing instance is destroyed and a login prompt is presented.User logs back in...
View ArticleRe : Stop/Start routing
Wouldn't it make sense to create a #login and #logout route as well? That way it would change and the user knows where they are?
View ArticleRe : Stop/Start routing
Actually I disagree with that approach. It's how we had it.Loging in is not a location, it's a modal dialog. It's a prompt to have you authenticate. It's not where you want to be. There is no reason to...
View ArticleStatic init vs prototype init
I have recently started working with CanJS. While I was going through the documentation I learned that CanJS uses static init and prototype init. What is not clear for me is that the purpose of static...
View ArticleRe : Stop/Start routing
Well I would probably keep my application state outside of the route if they don't correspond. Pass it to each control and listen to e.g. '{state} credentials' so when the user logs in you set...
View ArticleRe : Mustache views and deferreds
Can not make it work, could you check this fiddle?http://jsfiddle.net/xKc3H/44/
View Article