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

Re : Passing a boolean to can component

I thought about not including selectable=".." and that works as long as the default is false. But it is not a great solution, as the default might be true in some cases. I wonder about this:...

View Article



Re : Passing a boolean to can component

asavoy,  Actually doing: define: {   selectable: {type: "boolean"} } should work.  You can see the rules here: https://github.com/bitovi/canjs/blob/master/map/define/define.js#L139 selectable="true"...

View Article

Re : Passing a boolean to can component

So the question is less "how do you pass a boolean" ... more "how do you convert a string to a boolean" - the define plugin!

View Article

Re : Passing a boolean to can component

What about defining: selectable (just presence of attribute) -> true  and maybe such API for false value: no-selectable -> false

View Article

Re : Passing a boolean to can component

@Justin I agree with your solution, it is the same as in my fiddle response to OP :) @alex Unclear how you would live-bind a value with that approach. Say if you wanted to toggle selectable.

View Article


Re : Passing a boolean to can component

@asavoy well this would work for fine for static parameters, I often met cases when you have static properties that defines the behaviour for particular instance of the component. but live binding...

View Article

Re : Passing a boolean to can component

@justin No, the question is not how do to use the define plug-in to convert a string to a boolean, this can be done.  The question is how to do you pass a boolean without using the define plug-in.  I...

View Article

Re : Passing a boolean to can component

I think define plugin should be embedded in can.js core, I use it almost for every model.

View Article


StealJS build error - 'MODULE_NOT_FOUND' } Error: Cannot find module 'less'

Loading my application with StealJS in development works great. When I try to build a production version. I'm getting a 'MODULE_NOT_FOUND' } Error: Cannot find module 'less'. If I remove the...

View Article


Re : StealJS build error - 'MODULE_NOT_FOUND' } Error: Cannot find module 'less'

which version are you using?  0.3.0?

View Article

Re : StealJS build error - 'MODULE_NOT_FOUND' } Error: Cannot find module 'less'

I'm using Steal 0.3.0    

View Article

What is the best way to reorderng items in DOM?

In my app I have the can.Model.List of articles, which have attribute "position". When I changing that attribute I want that articles will reordering in a document (DOM). The easiest way is do rerender...

View Article

Re : New StealJS

That branch version of CanJS includes the converters for templates, so you'd need to use the branch version if you want to import templates into the build. ext: { ejs: "can/view/ejs/system", mustache:...

View Article


Re : What is the best way to reorderng items in DOM?

Make a fiddle

View Article

Using CSS and LESS dependencies with StealJS 0.3.0

Hello I'm getting unexpected results with StealJS. (using StealJS 0.3.0) I'd like to load both a .css file and a .less file. But I want the .css file to be included first. This works great in...

View Article


Re : What is the best way to reorderng items in DOM?

I make simple fiddle: http://jsfiddle.net/GE3yf/30/

View Article

Re : Using CSS and LESS dependencies with StealJS 0.3.0

Can you create a test page / example in steal-tools/test ? Also, dependency order does not matter (and we won't make it matter).  Meaning you can't rely on the order of     'css/reset.css!',...

View Article


Re : Using CSS and LESS dependencies with StealJS 0.3.0

use steal-tools 0.4.0 too

View Article

Re : Using CSS and LESS dependencies with StealJS 0.3.0

Thanks Justin, I understand that dependency order doesn't matter I only wanted to point out that dependency order seemed to matter to steal-tools build. I've updated steal-tools to 0.4.0. Thanks for...

View Article

Image may be NSFW.
Clik here to view.

Catching can.view load errors

Hi there, How can I catch load errors for a can.view call? I currently have code like: can.view(self.options.view, data, function(frag)               {                 self.element.html(frag);...

View Article
Browsing all 3491 articles
Browse latest View live




Latest Images