Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 19 19:39
    msa46 starred canjs/canjs
  • Jun 14 20:48
    ParthPandey2611 commented #5509
  • May 02 09:48
  • May 01 13:11
    joanthethings starred canjs/canjs
  • Apr 25 23:14
  • Apr 18 07:24
    catafest-work starred canjs/canjs
  • Apr 11 18:13
    maxgrass starred canjs/canjs
  • Apr 04 00:00
    mvandermeulen starred canjs/canjs
  • Mar 31 19:44
    robertkraig starred canjs/canjs
  • Mar 16 02:44
    jiangtao starred canjs/canjs
  • Mar 08 18:20
    beardordie starred canjs/canjs
  • Mar 06 09:02
    frank-dspeed commented #5459
  • Mar 06 09:01
    frank-dspeed commented #5459
  • Mar 06 09:01
    frank-dspeed commented #5459
  • Mar 04 17:03
    justinbmeyer commented #5459
  • Mar 04 16:41
    rjgotten commented #5459
  • Mar 04 16:23
    SKFrozenCloud commented #5459
  • Mar 04 16:02
    SKFrozenCloud starred canjs/canjs
  • Mar 04 03:10
    Rainnut starred canjs/canjs
  • Mar 03 20:08
    kaustav202 starred canjs/canjs
Kevin Phillips
@phillipskevin
we can check if it’s working in 1.0
Justin Meyer
@justinbmeyer
@jeroencornelissen I would put a destroyList or some method on your list that makes the requests
and then call destroyedInstance on each one (assuming can-connect)
lmagarian
@lmagarian
I'm getting this error: Error: TypeError: Cannot redefine property: _instanceDefinitions
at Function.defineProperty (<anonymous>)
at defineConfigurableAndNotEnumerable (can-define.js:32)
at DefineMap.define.setup (can-define.js:712)
at DefineMap.setup (map.js:113)
at Function.newInstance (can-construct.js:289)
at DefineMap.init (can-construct.js:594)
at new DefineMap (eval at <anonymous> (can-construct.js:NaN), <anonymous>:3:32)
at Object.observable (can-define.js:818)
at Object.eval (can-define.js:708)
at each (each.js:39)
From this code: Message.get({ "id": messageId })
What does it mean, and how do I fix it?
Frank Lemanschik
@frank-dspeed
it means you should post a issue fully described in can-define project on github
i guess
and befor that search for existing issues
Jeroen Cornelissen
@jeroencornelissen
@justinbmeyer What does calling destroyedInstancedo? I expected that it would remove my item from the list, but it doesn’t.
I’ve set up a jsbin with how I thought it would work. See the removeAllItems function.
http://jsbin.com/noguwup/9/edit?html,js,output
Kevin Phillips
@phillipskevin
@lmagarian what does Message look like?
@jeroencornelissen I think you just want destroy
Jeroen Cornelissen
@jeroencornelissen
@phillipskevin no that would result in additional backend requests. I would like to prevent that from happening.
Kevin Phillips
@phillipskevin
Oh, ok. Sorry. I remember now what you’re trying to do.
don’t you have to make those requests at some point? in order for the items to be deleted on the server.
Jeroen Cornelissen
@jeroencornelissen
inside Item.List i have a function called destroyList that does that (as suggested by Justin)
Jeroen Cornelissen
@jeroencornelissen
I have cross-posted my question on the forums, so it wouldn’t get lost in this channel:
http://forums.donejs.com/t/bulk-actions-destroy-update-on-multiple-items/575
Justin Meyer
@justinbmeyer
deepasrikanth
@deepasrikanth
hi I have a question regarding components. I have a generic component that I would like to use from other components
This generic component will display a small ui with buttons where the click handler will be implemented in the component that is consuming the generic component.
though I am able to pass the callback function name as the click handler, it appears that the scope is not clear. When I execute the code its looking for the callback implementation in the generic component where as its available in the context its being called. How can I address this?
Kevin Phillips
@phillipskevin
you’ll want to pass the function in to the generic component
deepasrikanth
@deepasrikanth
I am passing function name. The function is in the viewModel of the calling component . Are you suggesting that I should pass the function code itself?
Kevin Phillips
@phillipskevin
so in the parent component, do something like <generic-component {handler}=“@clickHandler” />
and then in the generic-component, you’ll do ($click)=“handler()”
is that what you’re doing now?
deepasrikanth
@deepasrikanth
yes
Kevin Phillips
@phillipskevin

let me make my names more clear. In the parent component:

<generic-component {generic-click-handler}=“@parentClickHandler” />

and then in the generic-component template:

($click)=“genericClickHandler()
deepasrikanth
@deepasrikanth
ok generic-click-handler is not a function in the generic component. I have that as a property. If I change that as a function that should fix it ?
Kevin Phillips
@phillipskevin
in the genericComponent viewModel it will just be a property that you can overwrite, like
GenericComponentViewModel = can.DefineMap.extend({
    genericClickHandler: 'any'
});
deepasrikanth
@deepasrikanth
trying that
that worked than you very much :)
*thank
Kevin Phillips
@phillipskevin
you’re welcome. glad it worked!
Rob Lao
@viewplatgh
Hi, what's the replacement of map.attr in can 3? i.e. how to set attribute of can map when attribute name is stored in a variable in can3?
Gira Minus
@gKreator
Map.set
Kevin Phillips
@phillipskevin
can-map still has attr in can 3: http://canjs.com/doc/can-map.prototype.attr.html
if you’re using DefineMap, then you want `set: http://canjs.com/doc/can-define/map/map.prototype.set.html
Kevin Phillips
@phillipskevin
CanJS 3.5.0 is out: https://github.com/canjs/canjs/releases/tag/v3.5.0. :shipit: :tada: :sparkles:
Gira Minus
@gKreator
any notable changes?
Kevin Phillips
@phillipskevin
a couple new features for can-connect
can-validate / can-validate-validatejs should really help with validation
can-connect-signalr is notable (if you’re using ASP.net / SignalR)
you can now use can-event/lifecycle as a mixin
all the can-* packages have been updated to use Steal 1.0
Gregg Roemhildt
@roemhildtg
I have a super map, but if I need to override the behavior of getListData...etc would I just create a behavior that does this? Can you add a behavior to supermap?
Nico R.
@nriesco
I posted a question in stackoverflow related to applying the MVVM pattern correctly using donejs, supermodels and components: http://stackoverflow.com/questions/42874841/correctly-modeling-a-mvvm-application-in-donejs
Frank Lemanschik
@frank-dspeed
@roemhildtg please look in the supermap repo on github you will find out itself is only a combination of behaviors so you can simply copy that and add your and then use map directly
Gregg Roemhildt
@roemhildtg
ok I see
Nico R.
@nriesco
quick question, here: https://github.com/donejs/bitballs/blob/master/public/components/tournament/details/details.stache#L23 the following is used: {{#../teams.getById(homeTeamId)}} how does that work? besides the fact that I only thought possible to use {{#keyword}} with a reduced number of words there is also a parametric way of choosing that keyword? what about closing that tag, isn’t that necessary? thanks
Szabolcs Schmidt
@sszabolcs

Hi!

I don't know if I'm missing something or there is a memory leak in CanJs 3.
Following these steps anyone can reproduce the problem (I'm using Google Chrome):

  1. Open a new tab.
  2. Press F12 to show developer tools.
  3. Open http://www.place-my-order.com/
  4. Switch to Profiles tab on developer tools and take a heap snapshot.
  5. Click on the Restaurants link on the place-my-order page, then click on the Home link.
  6. Take another heap snapshot.
  7. Repeat step 5. and 6.
  8. On the Profiles tab select Snapshot 3 and list 'Objects allocated between Snapshot 1 and Snapshot 2'.
  9. Select for example the HTMLAnchorElement and view the details.
    There are three detached HTMLAnchorElement DOM elements that are not garbage collected.
    screenshot
Gira Minus
@gKreator
I ran into something like this, i dont remember much but has to do with the dev tools themselves