Quantcast
Channel: JavaScriptMVC Forum
Browsing all 3491 articles
Browse latest View live

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 Article



Mustache 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 Article

Re : 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 Article

Model.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 Article

Add 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 Article


Re : 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 Article

Re : 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 Article

Re : 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 Article


Re : 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 Article


Re : Add customized functions to Model

The CanJS docs are pretty comprehensive.

View Article

Re : 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 Article

Re : 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 Article

Re : Add customized functions to Model

That's a great source and I'll practice with that.

View Article


Re : 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 Article

Stop/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 Article


Re : 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 Article

Re : 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 Article


Static 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 Article

Re : 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 Article

Re : Mustache views and deferreds

Can not make it work, could you check this fiddle?http://jsfiddle.net/xKc3H/44/

View Article
Browsing all 3491 articles
Browse latest View live




Latest Images