Ability to do a replace(someId, templateCall())

Submitted by Zef Hemel on 29 March 2010 at 20:02

On 31 March 2010 at 12:20 Zef Hemel commented:

Not necessary, can be implemented as follows:

    var editing = false
    template defaultView() {
      item(onclick={ editing = true; }) {
        inputCheckbox(t.done, onclick={}) " "
        outputString(t.name)
      }
    }
    template swipedView() {
      item(onclick={ editing = false; }) {
        inputCheckbox(t.done, onclick={}) " "
        outputString(t.name)
        deleteButton("Delete", onclick={ remove(t); })
      }
    }
    (editing ? swipedView : defaultView)()

Log in to post comments