Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select Order Items - Why Print "2"?
01-25-2018, 08:24 AM, (This post was last modified: 01-25-2018, 08:44 AM by TurboPT.)
RE: Select Order Items - Why Print "2"?
Believe it or not, the 'selection' CSS actually has nothing to do with the sorting. The sort handling references the <th> tag styles that have 'ascending' set and then javascript uses this reference to do the sorting.

What breaks the sorting -- for that specific table -- is actually the first and last rows that have the buttons.

So, if the first row is wrapped in a <thead> tag, and the last row in a <tfoot> tag, then the sorting is ok without any change to the <table> tag style. No <tbody> necessary either, though that was a good idea, and I'll likely keep that change too.

I'll make those changes (without the 'selection') and commit, as I noted another existing CSS improvement that can be applied in the same area as well.
01-25-2018, 08:55 AM,
RE: Select Order Items - Why Print "2"?
Very interesting information. Thank you for clarifying.
01-25-2018, 10:08 AM, (This post was last modified: 01-25-2018, 10:49 AM by TurboPT.)
RE: Select Order Items - Why Print "2"?
Changes committed to SVN.

Paul, (or anyone else crossing this post) to know more as to how the column sort handing is accomplished:
  1. The desired columns to have sorting capability must have the tag <th class="ascending"> applied.
  2. The file that works with that CSS class is: javascripts/MiscFunctions.js.
  3. At the bottom of the MiscFunctions.js file, the window.onload event is set to a function named initial.
  4. Inside the bottom of the initial function is where the <th> tags are retrieved.
    • All the discovered <th> tags are looped to find any that have the ascending CSS presence, which is determined by the element's className property in javascript, and sets a function named SortSelect to the <th> element's onclick handler.
  5. The SortSelect function handles the sorting when a column name (or column heading) is clicked!
TIP 1: Note that a click anywhere on a column name (specified to sort) will trigger sorting. The small sort indicator is present for appearance and does not have any event handling.
TIP 2: Know that the sort handling expects all the rows to have the same number of columns.
01-25-2018, 10:40 PM,
RE: Select Order Items - Why Print "2"?
Paul, there are some improvements to the sorting function, and also some table changes are needed on some tables to make the sort correctly. I sent this to Raphael ages ago and he was going to commit it, but I assume he has got tied up on other things. I know I have posted about exactly what needs doing and my improved sorting function at least once before so searching for it should give you the information you need.

If you cannot find it drop me a line and I will see if I can dig out my correspondence with Rafael.

01-26-2018, 09:04 AM,
RE: Select Order Items - Why Print "2"?
Ok, I'll see if I can find that after the pick list stuff.
01-26-2018, 09:09 PM,
RE: Select Order Items - Why Print "2"?

Forum Jump:

Users browsing this thread: 1 Guest(s)