Skip to content

Instantly share code, notes, and snippets.

@MrChrisRodriguez
Created November 4, 2013 18:27
Show Gist options
  • Save MrChrisRodriguez/7307054 to your computer and use it in GitHub Desktop.
Save MrChrisRodriguez/7307054 to your computer and use it in GitHub Desktop.
Google: Order groups by group name alphabetically. Requires jQuery
name_and_row = {};
center_panel = jQuery("#center-panel tbody");
center_panel.children().each(
function(i,e){
e = jQuery(e);
name_and_row[e.children(":nth-child(2)").text()] = e
})
reversed_rows = Object.keys(name_and_row).sort().reverse()
jQuery(reversed_rows).each(function(i,tag){
console.log(tag);
center_panel.prepend(name_and_row[tag])
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment