sorting based on two columns, results alternate between columns.
sorting based on two columns, results alternate between columns.
rockyinteractive
Posts: 2Questions: 0Answers: 0
I'm not sure if this can be done, but I would love to be able to sort based on two columns and have the results alternate between both columns. I have a list of employees names/phone numbers and instead of listing them all in one column, I wanted to create a two column table and still have the ability to sort/filter both columns.
So instead of the results getting returned to just the one column, the first result would go in row 1 col 1 and the second result would go in row 1 col 3, the third result would go in row 2 col 1, and the next row 2 col 3...etc
I want to eliminate some scrolling and use the horizontal size that I'm given.
Example:
[code]
Person (col 1)
Person (col 2)
Bob
Fred
Joe
Greg
Jill
Sarah
[/code]
So instead of the results getting returned to just the one column, the first result would go in row 1 col 1 and the second result would go in row 1 col 3, the third result would go in row 2 col 1, and the next row 2 col 3...etc
I want to eliminate some scrolling and use the horizontal size that I'm given.
Example:
[code]
Person (col 1)
Person (col 2)
Bob
Fred
Joe
Greg
Jill
Sarah
[/code]
This discussion has been closed.
Replies
It's possible to do this when using server-side processing, because DataTables doesn't really care what the data that is returned from the server is - so on the server-side you just apply the loop as needed, but not really when using client-side processing. Sorry.
Allan
Is there a way to process the date before it gets pushed to the table? For example, I have a url that I would like to build and wrap around a title and image. Would you recommend returning the output as a built link or is there some sort of processing that could manipulate the data before building the table.
Allan