Untitled

mail@pastecode.io avatar
unknown
javascript
a year ago
428 B
0
Indexable
Never
function renderTable(renderTarget, columnSpecs) {
    $(renderTarget).find('tr').click((event) => {
        const colId = tr.data('col-id'),
            columnSpec = columnSpecs.filter(c => c.id = colId)
        
        if (columnSpec.length == 0) {
            return
        } else if (columnSpec[0].onClick === undefined) {
            return
        } else {
            columnSpec.onClick()
        }
    })
}