2

I'm using the jQuery footable plugin to display tabular data. I am familiar with using the sortValue parameter to sort my columns based on integer vals etc. Imagine a table with three columns:

Amount | Days | AVG

I calculate the AVG per Day by using the formatter

 formatter:(v,o,d)=>{
            let avg = d.amount/ d.days
                return avg .toFixed(0);
        }},

That is possible because I can access all values of the corresponding row through the d variable.

However, the footable sortValue function apparently only takes a single parameter, for example:

"sortValue": (v)=>{return parseInt(v)}

I've read the documentation and I can not find any reference on how to sort a column based upon computed values from other columns. I could resort to calculating the AVG values server side, but I would prefer to solve it using a footable method client side.

Can someone point me into the right direction ?

unit303
  • 71
  • 7

0 Answers0