Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handy way to get cell components #177

Open
lachdoug opened this issue May 15, 2018 · 0 comments
Open

Handy way to get cell components #177

lachdoug opened this issue May 15, 2018 · 0 comments

Comments

@lachdoug
Copy link

I've found that a cell/component can be selected by its ID name alone, without using querySelector or the like.

Here, in the keyup function, the first component is selected with myConsole, rather than document.querySelector("#myConsole")

ಠᴥಠ = {
  $cell: true,
  $components: [{
      id: "myConsole"
    }, {
      $type: "input",
      onkeyup: function(e) {
        if( e.keyCode === 13 ) { myConsole.$text = this.value; }
      }
    }
  ]
}

This a nice feature. Maybe it could be mentioned in section 3 of the tutorial.

BTW, thanks for cell.js. I'm a big fan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant