Getting data
Hi everyone, I'm very new to Canjs and I have a question. I'm using a PHP framework as backend; one controller return server file/folder list as json array. I could create a 'Model' with findAll method...
View ArticleRe : Getting data
A simple Ajax call can do the job, but it's not going to give you observable instances that can have helper functions, etc. When your app gets more complex, using can.Model will pay off big time.
View ArticleRe : 2 the same objects
All of the methods are coming from the prototype of Position, so you should not expect them to be different. Deep copy as implemented in jQuery doesn't apply to functions, only things for which typeof...
View ArticleRe : 2 the same objects
What are you trying to accomplish by doing this?While globals are not recommended, in this case you could simple do:window.Obj1 = new Position('#null2', {});window.Obj2 = new Position('#null3', {});The...
View ArticleTypeError: Cannot find function querySelectorAll in object [object...
envjs gives out this error when building. I found out it was introduced by a jquery plugin using querySelectorAll method which envjs does not define it seems. Is it possible to add this method on the...
View ArticleWorking with route pushstate
I want my app when it is accessed by URL http://app.domain/{language} When I load the app with address http://app.domain/en I have an "en" language set.I if set browser's address line is changed...
View ArticleCanJS with React.js
Did anyone tried to use React.js as a view layer for CanJS? I'm running into performance problems using ejs live-binding with a lots of data (500 rows table) and React is supposed to be really fast on...
View ArticleRe : CanJS with React.js
What performance problems? It's possible you are not writing out your template correctly. Maybe create a fiddle showing the problem with mock data.
View ArticleBest/most effcient way to modify/augment model list data returned after...
Currently, when I return a set of data from the JSON service I get the Model List, loop it and read/write/modify properties to it. Is there a better way to handle this? I assume that CAN is looping...
View ArticleRe : Best/most effcient way to modify/augment model list data returned after...
findAll: function(params) { return can.ajax({ url: '/things', type: 'GET', data: params, dataType: 'json' }).then(function(things) { // Do whatever to...
View ArticleRe : Working with route pushstate
Using pushState doesn't mean that you can arbitrarily change the URL in the address bar and have it prevent server hits. You are limited to using the back/forward buttons and JS hooks, and doing...
View ArticleRe : Best/most effcient way to modify/augment model list data returned after...
Alternately, you can override can.Model.models/can.Model.model to do preprocessing on all data that comes back through the declarative layer (i.e. for findAll, findOne, create, and update):findAll :...
View ArticleHow to make functions in EJS template view
Hi I am new in JavascriptMVC and would like to know how to make a function inside a EJS view or if there are pre-made functions for sorting numeral data.Thanks you.
View ArticleRe : Best/most effcient way to modify/augment model list data returned after...
Ok cool thanks. What I have is something similar to thecountofzero. Haven't messed with supers yet but will look into.
View ArticleListen for change on model List aliased to controls options object
I've been trying, without luck, to do this:someModel.findOne().done(function( data ) { new someControl( '.domEl', { data: data } ); });can.Control.extend({ init: function() {...
View ArticleRe : Listen for change on model List aliased to controls options object
For the control to listen to events using the "{property} change" syntax, property must be defined on this.options before the controller's init() gets called.One way to ensure it's in the right place...
View ArticleRe : Listen for change on model List aliased to controls options object
For the control to listen to events using the "{property} change" syntax, property must be defined on this.options before the controller's init() gets called. Aren't I doing this by passing an options...
View ArticleRe : Listen for change on model List aliased to controls options object
Aren't I doing this by passing an options object when instantiating the control? new someControl( '.domEl', { data: data } ); Doing that will set a 'data' property on this.options -- so if you pass an...
View ArticleRe : Listen for change on model List aliased to controls options object
Wow nice thanks! Yeah, binding to an alias inside init() will not work. Now I'm just passing in a specific property for state on options, and/or listening on the sub property on options works as well...
View ArticleRe : Listen for change on model List aliased to controls options object
If you want to set up options after initial set up, call this.on(); to rebind the listeners defined in the control's prototype.Here's an example based on your initial code: init: function() {...
View Article