SHARE
TWEET

Untitled

a guest Jul 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var tabledata = [
  2.     {id:1, distance:"42", time:"13.90", speed:""},
  3.     {id:2, distance:"12", time:"5.70", speed:""},
  4. ];
  5. //custom mutator
  6. var speedMutator = function(value, data, type, params, component){
  7.     return Math.round(data.distance / data.time);
  8. }
  9. var table = new Tabulator("#example-table", {
  10.     data:tabledata,
  11.     columns:[ //Define Table Columns
  12.         {title:"Id", field:"id", visible:false},
  13.         {title:"Distance", field:"distance", editor:true},
  14.         {title:"Time", field:"time", editor:true},
  15.         {title:"Speed", field:"speed", mutator:speedMutator, mutatorEdit:speedMutator},
  16.     ],
  17. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top