1

I been doing some research on the internet and I haven't found anything yet. Simple question here, using datables, can I add a column based on calculations from different columns? Thanks

Edit. NVM, I think I got doing this

aoColumns: [

         { mData: 'column1' },
         { mData: 'column2' },

         { mRender: function(data, type, row){
                 return (row.column1/ row.column2) 
         }}
1
  • That syntax you're using is the old (pre 1.10) version of datatables. Commented May 26, 2015 at 23:29

1 Answer 1

1

Yes. The simplest way to do this is to use columnDefs and columns.render. There are various examples on the columns.render help page (https://datatables.net/reference/option/columns.render). If you find you can't achieve what you want with that, also check out the columns initialization property and the columns.data property.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.