These are chat archives for canjs/canjs

16th
Feb 2017
lmagarian
@lmagarian
Feb 16 2017 00:00
I'm trying to make a group of checkboxes bound to a DefineList of strings. Using this code:
<input type="checkbox" id="{{item}}" {($checked)}="boolean-to-inList(item, selectedKeys)" />
It is correctly setting the checked state when the page loads
I'd expected selectedKeys to be updated as the checkbox is checked or unchecked but it isn't. What do I need to do differently?
Kevin Phillips
@phillipskevin
Feb 16 2017 00:04
can you create a JSBin example?
can’t see anything wrong with just that line
Kevin Phillips
@phillipskevin
Feb 16 2017 00:12
lmagarian
@lmagarian
Feb 16 2017 00:19
ok, I modified that to use DefineList for the owns array and it still works
Kevin Phillips
@phillipskevin
Feb 16 2017 00:39
maybe you don’t have can-stache-converters imported in your app?
A walk through of how to build a file navigator ... you can probably skip the first 20 min or so if you are familiar with CanJS
@MarcGodard I wouldn't suggest using can.Control + routes like that
oh, looks like kevin talked to you about it
deepasrikanth
@deepasrikanth
Feb 16 2017 19:26
Hi there I need help with something
deepasrikanth
@deepasrikanth
Feb 16 2017 19:36
how can i disable cacheConnection? In other words I would like to force not to cache the data and fetch by hitting the API
I am using canJs 3
Kevin Phillips
@phillipskevin
Feb 16 2017 19:49
@deepasrikanth if you’re using superMap, you’ll have to change it so you can configure the behaviors yourself
and you can look at the superMap code for the behaviors it is using: https://github.com/canjs/can-connect/blob/master/can/super-map/super-map.js#L22-L48
deepasrikanth
@deepasrikanth
Feb 16 2017 19:55
ok thanks. I will check that out. If I have questions I will come back. Thanks again!
Kevin Phillips
@phillipskevin
Feb 16 2017 19:56
sure, no problem!
Morgan Heimbeck
@Xitstrategies
Feb 16 2017 20:08
in can v2 with a view.attr how do I properly get the attrData.scope._context? I can't do attrData.scope.attr(), etc.
deepasrikanth
@deepasrikanth
Feb 16 2017 20:51
Hi Kevin another question.. the problem I am facing that my view is not hitting the API to show the latest data. But if I visit the page again or refresh it works. So I was trying to find a way to disable caching. Hence my previous question. Is there any other way to refresh the view to show the latest instead of clearing cache?
Kevin Phillips
@phillipskevin
Feb 16 2017 20:54
maybe that’s not a caching issue
even with the fall-through cache, it will still make the request to the API
it will just give the cached data, then make the request to the API and update the response
what change is happening that should trigger the new request?
deepasrikanth
@deepasrikanth
Feb 16 2017 20:57
so I have a form in a view where I am creating a row of data.. another view should list all the rows of data
now on one tab I save new data and another tab I try to visit the list page and I don't see the new data. The API request does not show the new data as well. but If I go back by browser back or another way and come back to the list page... the api request shows new data. So I doubted the caching.
Kevin Phillips
@phillipskevin
Feb 16 2017 22:02
hmm, ok
it’s hard to say what’s happening
any way you can try to reproduce it in a jsbin?
deepasrikanth
@deepasrikanth
Feb 16 2017 22:19
I can try. I have not used it so far.
Kevin Phillips
@phillipskevin
Feb 16 2017 22:20
there is a link at the top of gitter that you can use to get started
deepasrikanth
@deepasrikanth
Feb 16 2017 22:27
So this code works if I use fixtures.. but this problem happens when I really hit the APIs that talk to my local mongo
If I copy the code in jsBin you won't be able to see the problem by running it but you can see the code I guess
Morgan Heimbeck
@Xitstrategies
Feb 16 2017 22:41
try doing this in your ViewModel instead of in the init
"eventGroups": {
    get: function() {
      return EventGroup.getList({});
    }
  },
deepasrikanth
@deepasrikanth
Feb 16 2017 22:46
will try that. I just tried this in my model definition "cacheConnection": "real-time",
seems to be working. is that a valid configuration?
deepasrikanth
@deepasrikanth
Feb 16 2017 22:57
never mind my last question
deepasrikanth
@deepasrikanth
Feb 16 2017 23:14
Thank you guys. changing super map to base map worked.