Sort order of automatic row height demo

Ask our community for help with v1.x versions of our products.

Sort order of automatic row height demo

Postby georepublic » Wed Mar 07, 2012 1:28 pm

I have implemented a schedule panel with variable row height for overlapping events like in this demo: http://bryntum.com/playpen/rowheight-gr ... eight.html

What is not clear to me is the sort order logic and how to change it. Can I specify the attribute to sort by within a single row?
In my particular case there are several overlapping events starting at the same time for example.

Is it possible to retrieve the order when the event is moved up or down. Then I would like to store its position and place the events again in the same order after reloading the event store.
georepublic
 
Posts: 2
Joined: Thu Jun 09, 2011 8:04 am

Re: Sort order of automatic row height demo

Postby mats » Wed Mar 07, 2012 3:51 pm

If you read the source, you'll know.... :) Just override this method:

Code: Select all
sortMethod: function (a, b) {
        var sameStart = (a.start - b.start === 0);

        if (sameStart) {
            return (a.text || '') < (b.text || '') ? -1 : 1;
        } else {
            return (a.start < b.start) ? -1 : 1;
        }
    },
We're hiring! We have an open position for an experienced Sencha developer (Ext JS and/or Sencha Touch). Contact us at jobs@bryntum.com

Follow us on Twitter: @bryntum or Facebook

Need professional services or training? Read more here.
API documentation
User avatar
mats
Core Developer
Core Developer
 
Posts: 7053
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden

Re: Sort order of automatic row height demo

Postby georepublic » Wed Mar 07, 2012 6:23 pm

Thank you!
Indeed, when you know where to search for it's not difficult. ;-)
georepublic
 
Posts: 2
Joined: Thu Jun 09, 2011 8:04 am


Return to Help (v1.x)

Who is online

Users browsing this forum: No registered users and 1 guest