Yeah, you're right. This is getting outside the bounds of what HtmlTable.Sort is trying to do. You'll need to write your own extension, and, unfortunately, I don't have time today to help you with it. Stick with it though; you'll figure it out.
On Wed, May 5, 2010 at 11:03 AM, Axel <[email protected]> wrote: > Many thanks for your answer and the secondary sort is very usefull to > see in action. > > As for the group sorting, I feel it's a litlle more tricky than 2 > sorts with one of them fixed ... > I have updated the example in order to picture the idea : > http://mootools.net/shell/f4hHs/ => Click On the text header and try > to keep parent child linked together > > My idea is to sort a table only on parent's rows. The child always > follow the parent which is moving according to the sort. That makes > kind of blocks moving. not only single rows. > > I have been wondering the best way to do so (Rows into rows, double > sorting as you suggested also, ...). But no results at the end. > > I'm currently digging the data.sort() part of the HtmlTable.sort.js > without success. I'm pretty sure the answer is there but I have > troubles to understand how it works... > > data.sort(function(a, b){ > if (a.value === b.value || a.value == b.valueParent) > return 0; > return a.value > b.value ? 1 : -1; > }); > > My idea would be not sorting when meeting a child element .. > > I appreciate your help and I'm pretty sure this could be helpfull in > many interfaces ... > > Axel. > > On 5 mai, 18:46, Aaron Newton <[email protected]> wrote: > > Not directly related, but I did a little demo of how to enable secondary > > sorting here: > > > > http://mootools.net/shell/463Mn/2/ > > > > If you wanted to group things, you should have another column in your > table > > that denotes their group id (this row can be hidden) and then always make > it > > the primary sort. > > > > > > > > On Tue, May 4, 2010 at 9:59 AM, Axel <[email protected]> wrote: > > > You mean reloading/pushing the table @ each sort ? Could you detail me > > > your thoughts ? > > > > > I would hope there is a more simple way to do so with HtmlTable Class > > > and Sort. I would think of updating the HtmlTable class with > > > groupClass Options but I can't figure how/when the sort is really done > > > into the class ... > > > > > Thanks again, > > > > > Axel. > > > > > On 4 mai, 17:28, "Steve Onnis" <[email protected]> wrote: > > > > Wouldn't it be easier just to use some ajax and some server side code > to > > > do > > > > your sorting? Especially if there is a lot of data. Atleast that way > you > > > can > > > > page the data > > > > > > -----Original Message----- > > > > From: Axel [mailto:[email protected]] > > > > Sent: Wednesday, 5 May 2010 12:59 AM > > > > To: MooTools Users > > > > Subject: [Moo] Group rows in Sorting > > > > > > Hello Mootools users too, > > > > > > I have been wondering a long time now, how to sort rows grouped... > > > > > > I'm running around and looking for the right solution to do this : I > have > > > an > > > > HtmlTable sortable by many columns. I want child rows to be sorted > > > together > > > > with their parent row. > > > > > > Example :http://mootools.net/shell/463Mn/ > > > > > > The First idea I had was to use the option onSort to resort the > current > > > > Table (Table.sort()) and pass the index+reverse+prepare to do this. > But > > > this > > > > was not a good idea as figured it out too late. > > > > > > Does anyone has a clue for me ? > > > > > > Many thanks for your help all, > > > > > > Axel. >
