Skip to content

Handy way to get cell components #177

@lachdoug

Description

@lachdoug

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions