Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 18 23:43
    1d0n7kn0w starred canjs/canjs
  • Feb 14 12:04
    CalvinWalzel starred canjs/canjs
  • Feb 13 05:42
    liyanlong starred canjs/canjs
  • Feb 11 22:25
    greenkeeper[bot] commented #5450
  • Feb 11 22:25

    greenkeeper[bot] on semver-7.1.3

    chore(package): update semver t… (compare)

  • Feb 11 19:20

    greenkeeper[bot] on steal-tools-2.2.6

    (compare)

  • Feb 11 19:06

    greenkeeper[bot] on steal-tools-2.2.6

    chore(package): update steal-to… (compare)

  • Feb 11 11:17

    greenkeeper[bot] on webpack-4.41.6

    (compare)

  • Feb 11 11:06

    greenkeeper[bot] on webpack-4.41.6

    chore(package): update webpack … (compare)

  • Feb 10 23:01
    cherifGsoul commented #5468
  • Feb 10 23:00
    cherifGsoul reopened #5468
  • Feb 10 22:59
    cherifGsoul closed #5468
  • Feb 10 22:59
    cherifGsoul commented #5468
  • Feb 09 05:23
  • Feb 08 20:24
    piraz opened #5468
  • Feb 08 10:41
    randy-r starred canjs/canjs
  • Feb 07 23:40
  • Feb 07 23:40
    MedRedha starred canjs/canjs
  • Feb 03 22:16

    greenkeeper[bot] on @octokit

    (compare)

  • Feb 03 22:15

    greenkeeper[bot] on @octokit

    chore(package): update @octokit… (compare)

Kevin Phillips
@phillipskevin
should be this.attr(‘playerRow.player’)
Christopher Oliphant
@RALifeCoach
sorry, I thought either would work - I will make the change
Kevin Phillips
@phillipskevin
the first will only trigger a render if player changes
but if playerRow changes it won't
Christopher Oliphant
@RALifeCoach
I don’t want either player or player row to change
I am simply trying at access them to test for a value
Kevin Phillips
@phillipskevin
I know you don’t want them to change
something sets playerRow
before that, playerRow will be undefined
so in order for your template to render when playerRow changes from undefined to the correct value, you need to listen to when playerRow changes
Christopher Oliphant
@RALifeCoach
are you suggesting I create an event on playerRow?
Kevin Phillips
@phillipskevin
no
using .attr() sets up a listener internally
so that stache knows to recompute your isActive function
and re-render
Mohamed Cherif Bouchelaghem
@cherifGsoul
@jeroencornelissen my-form should be removed and inserted everytime activeForm change
Christopher Oliphant
@RALifeCoach
@phillipskevin I made the change you requested (after being pulled away to work on two other priorities)
isActive is getting called again with ctr = 1
therefore playerRow is getting altered - the question is where?
is the stache file parsed and populated on the main thread?
Kevin Phillips
@phillipskevin
yes
can you just bind on playerRow and look at the stack trace to see what is changing it?
Christopher Oliphant
@RALifeCoach
can I bind in the Map events: { playerRow: function () […
or does it need to be on the component?
Kevin Phillips
@phillipskevin
on the map, you can add an init
then do
  init: function() {
    this.bind(‘playerRow’, function() { … });
  }
Christopher Oliphant
@RALifeCoach
BTW there is no Map.init in the documentation
thanks
Kevin Phillips
@phillipskevin
Map extends Construct
so init is on can.Construct
Christopher Oliphant
@RALifeCoach
that is very true, and it would have been nice to see it - especially with that example you just gave me
Mohamed Cherif Bouchelaghem
@cherifGsoul
@jeroencornelissen look at Tabs example you follow the same pattern to make it works https://canjs.com/docs/can.Component.html
Christopher Oliphant
@RALifeCoach
playerRow is being updated during the stache parsing and populating
Kevin Phillips
@phillipskevin
ok
you’re not expecting that?
Christopher Oliphant
@RALifeCoach
No
Kevin Phillips
@phillipskevin
how is playerRow defined?
Christopher Oliphant
@RALifeCoach
data = { playerRow: { …} }; var map = new mapBase(data);
This message was deleted
that is then inserted into the compoent
var template = can.stache('<player-row id="player-row-' + this.pid + '"></player-row>');
this.container.append(template(map));
Christopher Oliphant
@RALifeCoach
one point - I begin my stache file with {{#with playerRow}} so that I don’t have to qualify all the references to properties within playerRow
Kevin Phillips
@phillipskevin
does mapBase have a playerRow property?
Christopher Oliphant
@RALifeCoach
@phillipskevin when I remove the {{#with playerRow}} everything works
well, most things work
Kevin Phillips
@phillipskevin
ok, I’m not sure why that would be
if you’re able to reproduce the issue in a jsbin I can take a look
Julian
@pYr0x
@jeroencornelissen i thought that your question i have seen once. http://forums.donejs.com/t/modifying-view-after-rendering-finishes/52 I posted a possible solution. Maybe you have to restructure your code.
Jeroen Cornelissen
@jeroencornelissen
:point_up: 22 maart 2016 17:27
@cherifGsoul @pYr0x Do you mean something like this: http://jsbin.com/tuciqivuxi/1/edit?html,js,output
Look at the clicky function. It feels kind of wrong removing the component and inserting it again. I think the power of CanJS is the live binding, change one property and my app rerenders automaticilly.
Jeroen Cornelissen
@jeroencornelissen
@dbleier @pYr0x I added a reply to the existing forum topic:
http://forums.donejs.com/t/modifying-view-after-rendering-finishes/52/3