Skip to content

mutation of a cell #183

@Sejiko

Description

@Sejiko

I tried to Build a smart div which changes to an input if the user double clicks it and changes back after the
after the user has inserted some data.

So i tried this:

var ಠᴥಠ = {
    $cell: true,
    $type: 'span',
    $text: 'Text to change via input field',
    ondblclick: function () {
        this.$type = 'input';
    },
    onkeyup: function (e) {
        if(e.keyCode == 13) {
            this.text = this.value;
            this.type = 'div';
            console.log(this.value);
        }
    }
}

... well the first part was no problem to change this to an input field but now it doesnt change back leaving me with an input field.

Im not sure if this should work or not im new to cell.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions