Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82130

Populating a column after initial population and sort

$
0
0
Completely new to DataTables so forgive me if this is basic stuff.

I've previously used other JScript tables and they've had a way to populate a column after a table has been populated and sorted on/before display. This is useful as I load and create a table dynamically and, without sorting the data myself at either MySQL level or in an array, I have been able to populate the table with my raw data, sort it on (for example) Total Points, then populate the first column with the relevant position number that that score yields in the whole table list.

As an example:

Position Player Race1 Race2 Total Points
JP1 95 85 180
JP2 100 100 200
JP2 90 80 170

After initial sorting on Total Points the table would be displayed as follows:

Position Player Race1 Race2 Total Points
JP2 100 100 200
JP1 95 85 180
JP2 90 80 170

And after this I would like to populate the first column accordingly:

Position Player Race1 Race2 Total Points
1 JP2 100 100 200
2 JP1 95 85 180
3 JP2 90 80 170

Is this possible in DataTable or should I do this prior to loading the table?

Thanks in advance for any help!

Viewing all articles
Browse latest Browse all 82130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>