jQuery UI Widgets Forums Vue(New) Event in rendered button in a cell does not work

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Martin 9 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • suadik
    Participant

    Am rendering a button in a cell with cellRenderer, the button renders well but the events in the button doesn’t work.
    When I change the event from @click to onClick, it triggers but says deleteRow is not defined

    columns: [
       { text: 'Action', datafield: 'action', cellsrenderer: this.cellsrenderer, width: 130 }
    ]
    methods: {
      cellsrenderer: () => {
        return <code><button @click=&quot;deleteRow()&quot; type=&quot;button&quot; size=&quot;small&quot;> Enable </button></code>;
      },
      deleteRow(){
        console.log('clicked')
      }
    }

    Thanks


    Martin
    Participant

    Hello suadik,

    Please, have a loot at the following Example.
    Notice that cellsrenderer is not defined as arrow function so that this would be the scope of the component.

    Best Regards,
    Martin

    jQWidgets Team
    https://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.