ngduc / react-tabulator

React Tabulator is based on tabulator - a JS table library with many advanced features.
https://codesandbox.io/s/0mwpy612xw?module=/src/components/Home.js
MIT License
366 stars 84 forks source link

Is it possible to add rowClick just with hooks? #249

Open WildOsk opened 2 years ago

WildOsk commented 2 years ago

Is it possible to add rowClick just with hooks

  const rowClic = (ev, row) => {
    console.log(row, ev);
  };

      <ReactTabulator
        ref={(ref) => setReft(ref)}
        data={data}
        columns={columns}
        layout={"fitColumns"}
        options={options}
        rowClick={(e,row) => rowClic(e, row)}
      />

Demo: Codesandbox

ngduc commented 2 years ago

not sure why you meant but the rowClick prop is deprecated now, please use the new "events" prop and put rowClick in there.