Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

I am using jQuery DataTables for an internal analytics app and my users want to be able to use custom sort by writing expressions involving multiple columns (eg. "profit / num_orders + account_age") in Javascript. They want complete flexibility of using all columns in arbitrary mathematical expressions.

I have looked at type-based custom sorting and custom data source sorting (as detailed here: http://datatables.net/development/sorting) but cannot figure out a way to implement this.

What is the solution here?

share|improve this question

maybe im wrong since i never did something close to that but datatables don't provide such a feature for you, if i understand right what you are trying to do is aggregate multiple columns from the table by a math expression defined by the user.

throughout the years i never saw a plugin that powerfull, anyway since the subject here is about datatables the more dynamic thing about filtering that i know is this plugin https://jquery-datatables-column-filter.googlecode.com/svn/trunk/regex.html

if you don't know yet search on the web about pivot grid, they can provide more customization to the end user but again nothing that powerfull as you may like. here's a example http://www.igniteui.com/pivot-grid/overview

hope it helps.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.