Datatable body onclick not working

UI Components for React
Post Reply
mettok
Posts: 1
Joined: 20 Mar 2018, 12:12

20 Mar 2018, 12:18

Hi
I have a table like this.

Code: Select all

   
    showDetail(event) {
        console.log('dd')
 
    }
    runJob(){
        console.log("sadsadfas")
       
    }
 actionTemplate(rowData, column) {
        return <div>
            <Button type="button" icon="fa-play" className="ui-button-success"  onClick={this.runJob}></Button>
            <Button type="button" icon="fa-stop" className="ui-button-danger"></Button>
        </div>;
    }
    executionDetail(rowData, column){
        return   <a onClick={() => this.showDetail}>Job executions</a>;
    }
render() {
        return (
    
   <DataTable value={this.state.jobs} >
                        <Column field="name" header="Navn"/>
                        <Column field="executionCount" header="Antall kjøringer"/>
                        <Column body={this.executionDetail}/>
                        <Column body={this.actionTemplate} style={{textAlign: 'center', width: '6em'}}/>
                    </DataTable>
                    )
                     
It seems that onclick event does not work neither on link or button.
Do i do anything wrong here?

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests