title: Checkbox unchecked state
body: <p>I have the following function that returns me an array of the checkbox's that are checked.  </p>
  
  <pre><code>function grabData(checked) {
      return $('.product_category_selector' + (checked? ':checked' : ':not(:checked)')).map(function (index, chk) {
          return $(chk).data('id');
      }).get();
  </code></pre>
  
  <p>In my main processing function I currently have the 'state' hard coded to <code>1</code></p>
  
  <p>What would be the best way to make this dynamic?</p>
  
  <p><strong>Full Code:</strong></p>
  
  <pre><code>        $('body').on("click", "#brands_by_category_submit_btn", function (e) {
               e.preventDefault();               
              var self       = $(this);
              var sortOrder  =  []; 
              var id         = $("#manID").data("id");
              var brand_name = $("#brand_name").data("id");
              var data       = grabData(true);
  
              $(".order").each(function(){
                  sortOrder.push($(this).val());
              })
  
              if(data.length)
              {
                  var data_array = { 
                      id : id,
                      brand_name : brand_name, 
                      cat_id     : data,
                      sortOrder  : sortOrder, 
                      state      : 1
                  };
  </code></pre>