Skip to content

Instantly share code, notes, and snippets.

@eladmeidar
Created August 10, 2009 16:06
Show Gist options
  • Save eladmeidar/165261 to your computer and use it in GitHub Desktop.
Save eladmeidar/165261 to your computer and use it in GitHub Desktop.
## html
<span>Select:</span>&nbsp;<a href="#" id="select_all_pending" class="select_all">Pending</a>,
<a href="#" id="select_all_expired" class="select_all">Expired</a>,
<a href="#" id="select_all_valid" class="select_all">Valid</a>
## js
function setupPostsFilter(){
if ($(".select_all")) {
//$("clear_token_filter").click(function(){
// clearCheckBoxes();
// });
$(".select_all").removeClass("active_select");
$("a.select_all").click(function(){
$(this).addClass('active_select');
var selected_token = this.id.split('_')[2]; //$("#status_token_select :selected").text();
clearCheckBoxes();
$("INPUT[@type=checkbox].post_" + selected_token).each(function(){
$(this).attr("checked",true);
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment