webERP Forum

Full Version: Select Order Items - Why Print "2"?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 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.
Very interesting information. Thank you for clarifying.
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.
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.

Tim
Ok, I'll see if I can find that after the pick list stuff.
Pages: 1 2
Reference URL's