Here's a JSFiddle to what I have working so far: http://jsfiddle.net/FmBFt/1/ My problem is adapting the demo code to do what I want. The Isotope docs aren't that helpful for noob coders such as myself.
To explain what I need
I'm using ISOTOPE and have 6 categories. Each category will have any number of boxes within it. So the lilac category might have 3 boxes within it and the green category may have 8 boxes and so on. I have a list of links to each category. When a category name is clicked (for example: lilac category) I need all boxes with the top lilac border to be sorted by its class name "l" and moved to the top. I then want those lilac boxes to be sorted in order of date added, the most recent box displayed first. I would like that sorting functionality to be applied to all categories but really haven't a clue how to do it.
I noticed that you can sort by "date-category" but all that does is group all categories together, it doesn't move a certain category to the top like I need.
I haven't a clue how to adapt http://jsfiddle.net/FmBFt/1/ to do what I want, could anyone help me out?
EDIT: Well I have one answer so far that has just confused the hell out of me but I'm pretty sure my problem lies with the getSortData function within my JS:
getSortData : {
blogs : function( $elem ) {
return $elem.find('.blogs');
},
symbol : function( $elem ) {
return $elem.attr('data-symbol');
},
category : function( $elem ) {
return $elem.attr('data-category');
},
number : function( $elem ) {
return parseInt( $elem.find('.number').text(), 10 );
},
weight : function( $elem ) {
return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
},
name : function ( $elem ) {
return $elem.find('.name').text();
}
}
The category call in the code above looks like it could do it but I just need to find out how to adjust, at the moment all it does is group every category together but I need to group one at a time...anybody?