Add a tag to a custom button in the Editor

Add a tag to a custom button in the Editor

sdroulerssdroulers Posts: 43Questions: 14Answers: 0
edited March 2018 in DataTables

Hi,

I'm customizing some buttons on my Editor instance and it works pretty well:

counting_editor
    .title('My custom editor')
    .buttons([{
        text: '<i class="fa fa-barcode"></i> <i class="fa fa-print"></i>',
        action: function() {
            alert('Print good pieces')
        },
        className: 'btn-success'
    }, {
        text: '<i class="fa fa-barcode"></i> <i class="fa fa-print"></i>',
        action: function() {
            alert('Print errors')
        },
        className: 'btn-warning'
    }])
    .create();

<button class="btn btn-default btn-success" tabindex="0">...</button>

(even thought it generates unecesserary class names but I'll look it later)

What I would like to achieve is adding a custom tag to this created button like so:

<button class="btn btn-default btn-success" tabindex="0" v-on="mouseover: mouseOver">...</button>

It would enable me to use some Vuejs actions on this button.

I could achieve the expected result with some jQuery on opening the form:

 $('.btn-success').attr( "v-on","mouseover: mouseOver");

but is there a better way?

Thanks!

Answers

  • sdroulerssdroulers Posts: 43Questions: 14Answers: 0
    edited March 2018

    Well well well ... this won't work anyway because the buttons are created outside of my vueJs template (so outside of its scope).

    I'll have to scratch my head a bit more

This discussion has been closed.