title: Bootstrap Selectpicker
body: <p>I have a selectpicker, which dynamically builds dropdown values and will have 'All' as first option. I need to do select All/None when clicked on 'All' and also when remaining any options are selected/unselected, need to check/uncheck 'All'. Am able to get Select All/None with the following code. Need help in unchecking/checking 'All' when remaining options are checked/unchecked.</p>
  
  <pre><code>$('.selectallselstatus').click(function() {
      var firstli = $('a.selectallselstatus).parent();
      if (!firstli.hasClass('selected')) {
          $('.selectpicker.selstatusall').selectpicker('selectAll');
          $("button[data-id='selstatus']").attr('title', "All");
          $("button[data-id='selstatus']").find('&gt; span[class="filter-option pull-left"]').text($("button[data-id='selstatus']").attr('title'));
      } else {
          $('.selectpicker.selstatusall').selectpicker('deselectAll');
      }
      return false;
  });
  </code></pre>