Enter YUI Button in DataTable

I have a YUI DataTable with various columns representing a list of users. I would like to add a column containing a button in each row with a specific label (say, "access to access") and which calls some function when pressed. Is it possible?

I tried to check the YUI documentation, but as far as I can see, they do not allow you to change the shortcut of the button itself in the way I mention here. Any clues?

+3
source share
1 answer

In the column definitions, you must specify the ala formatter

var myCols = [
    ... /* your other cols */
    {
        key: 'foo', formatter: function (cell, rec, col, data) {
            cell.innerHTML = '<button type="button">'+data+'</button>';
        }
    }
];

, .

+6

Source: https://habr.com/ru/post/1714252/


All Articles