Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTables Wonky: Some columns don't sort, others don't sort properly. #11

Open
Eingang opened this issue Feb 1, 2019 · 0 comments
Open

Comments

@Eingang
Copy link

Eingang commented Feb 1, 2019

Summary

The AJAX DataTables configuration used provide individual column sorting on the various calculation display pages doesn't work consistently/correctly, some tables don't have column sorting at all, and the text alignment of data is inconsistent.

Discussion

All tables have been enabled for AJAX DataTables column sorting except for Past Billing Invoices (Corporation Mining) and Past Billing Invoices (Corporation PvE). Where column sorting is available, columns holding ISK values, where ISK is present as a cell value, do not sort numerically correctly in ascending or descending order. This is likely because DataTables perceives the column values as being string values when you tack on ISK instead of as doubles or floats.

This theory is supported by Past Billing Invoices (Individual Mining) -> Mining Amount sorting numerically correctly and it's missing the ISK bit unlike the equivalent in other tables. The same issue also likely applies to the Registered Users, Adjusted Value, and Tax Owed (or Tax Due) columns in tables.

Some tables have columns that don't work at all. This seemed to only obviously be the Character Name column on any kind of Individual Mining summary table. No idea why it doesn't seem to work there but it does work in other tables.

A number of column headers (and/or values) are inconsistent. Most tables use Mined Amount, but some use Mining Amount. Some of those columns include ISK in the value and others don't. Some tables have Tax Due but most have Tax Owed. Market Modifier is referred to as Percentage of Market Value and Mining Tax Modifier in places. Most tables use Tax Rate but some use Mining Tax.

All columns with ISK or percentage values should have two decimal places and the values should be right-aligned in the table. Sometimes that seems to be the case, but not consistently. For example, Current Billing Summary (Corporation PvE) -> Total Bounties looks to be right-aligned, but Current Billing Summary (Individual Mining) -> Tax Due isn't. Obviously Corporation and Character Name don't need to be right-aligned. The rest of the columns probably should be.

Problem Summary

Handy summary of problems on a page-by-page, column-by-column basis:

Current Billing Summary (Corporation Mining)

  • Percentage of Market Value: Column name inconsistent with other tables. Should be Market Modifier.
  • Registered Users: Sorts alphabetically on the whole string instead of either on the first number (number of registered users) or the last number in the brackets (percentage registered). Amounts should be right-aligned.

Current Billing Summary (Corporation PvE)

  • Total Bounties: Doesn't sort numerically in ascending/descending order correctly. Amounts should be right-aligned.
  • Tax Owed: Doesn't sort numerically in ascending/descending order correctly. Amounts should be right-aligned.
  • Registered Users: Sorts alphabetically on the whole string instead of either on the first number (number of registered users) or the last number in the brackets (percentage registered). Amounts should be right-aligned.

Current Billing Summary (Individual Mining)

  • Character Name: Column sort doesn't do anything at all.
  • Mining Amount: Doesn't sort numerically in ascending/descending order correctly. Amounts should be right-aligned. Column name inconsistent with other tables. Should be Mined Amount.
  • Mining Tax Modifier: Column name inconsistent with other tables. Should be Market Modifier.
  • Mining Tax: Column name inconsistent with other tables. Should be Tax Rate.
  • Tax Due: Column name inconsistent with other tables. Should be Tax Owed. Doesn't sort numerically in ascending/descending order correctly. Amounts should be right-aligned.

Past Billing Invoices (Corporation Mining)

  • This table doesn't have any column sorting enabled for any of the columns. Numeric amounts should be right-aligned.

Past Billing Invoices (Corporation PvE)

  • This table doesn't have any column sorting enabled for any of the columns. Numeric amounts should be right-aligned.

Past Billing Invoices (Individual Mining)

  • Character Name: Column sort doesn't do anything at all.
  • Mining Amount: Missing "ISK" currency designation and two decimal places. Former likely causes this column to sort correctly!. Amounts should be right-aligned. Column name inconsistent with other tables. Should be Mined Amount.
  • Mining Tax: Column name inconsistent with other tables. Should be Tax Rate.
  • Tax Due: Column name inconsistent with other tables. Should be Tax Owed. Doesn't sort numerically in ascending/descending order correctly. Amounts should be right-aligned.

Other Comments

OK, technically the right-alignment isn't a sorting issue, but rather a formatting issue. But it's related. That's my story and I'm sticking to it.

As for fixing things… For the ISK-related issues, you might be able to use the Any Number DataTables plug-in. Or… simpler: Put the currency unit in the column header instead of in each of the values, and then the default sort will likely work for ISK columns. No clue on the Registered Users one. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant