Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
lmagarian
@lmagarian
@chasenlehara thanks!
Nico R.
@nriesco
@phillipskevin your approach does work (instead of {{#with}} access to each variable using newPerson.xxxxx)
but I fixed other stuff at the same time so I need to make sure if that was actually the solution or not
I’ll let you know asap
Kevin Phillips
@phillipskevin
ok, thanks
Nico R.
@nriesco
@phillipskevin yes, somehow {{#with}} is not working correctly, I’ll try one last thing..
Kevin Phillips
@phillipskevin
only in donejs?
Nico R.
@nriesco
no it didn’t work (wrap it with an {{#if}} statement)
only in donejs
Kevin Phillips
@phillipskevin
what about just
{{#newPerson}}{{/newPerson}}
Nico R.
@nriesco
I’ll try
cool that did the trick!!!
Kevin Phillips
@phillipskevin
can you open an issue for {{#with}} ?
in donejs/donejs
Nico R.
@nriesco
sure! thanks again!
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!