简体   繁体   中英

Adding a column to datatables framework

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) 
         }}

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM