On Oct 4, 7:22 pm, GhostRider <kenneth.t.lundst...@gmail.com> wrote: > Problem is that customer wants to sort the table in different why, > sometimes based on customer name, sometimes on product and sometimes > on pickup place. > > Any ideas on how to do this? > > I would like to make the table headers as links och sort the table > based on that. I was thinking about collecting all data in a temporary > table and make the sorting in SQL. > > Kenneth
I have been toying with how to implement this functionality in the future on http://www.zgus.com You should not need a new temporary table to sort the data the way you want to. The orderby parameter in web2py works successfully with table join queries. Also orderby in web2py can compound orderby expressions with '|'. My first impulse was to look at including some fancy javascript to play with the browser DOM. However two major well known distributors I use with line cards of over one million different product ids don't use this method. One uses javascript to encapsulate a parameterised postback (similar to dotnet) and the other just uses a self contained form surrounding a small image. With both methods that the server can simply determine what a customer wants to do and just simply just regenerate the data for display using a different orderby. Hence you can get a lot of sophistication for a little effort that avoids a complicated nightmare from messing about with the browser DOM. John Heenan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---