title: Bootstrap Table filter by string partial
body: <p>I'm using the Bootstrap-table plugin (<a href="http://bootstraptable.wenzhixin.net.cn/documentation/" rel="nofollow">http://bootstraptable.wenzhixin.net.cn/documentation/</a>) and I'm trying to filter by tags by utilizing the method <code>filterby</code> but can't figure out how to factor in multiple tags that has to come in as a string, separated by commas.</p>
  
  <p>I created an example to illustrate what I'm attempting to achieve. For simplicity, </p>
  
  <p>Here's the html:</p>
  
  <pre><code>&lt;table id="table"&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th data-field="date"&gt;Date&lt;/th&gt;
          &lt;th data-field="desc"&gt;Description&lt;/th&gt;
          &lt;th data-field="tags"&gt;Tags&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
  &lt;/table&gt;
  &lt;br&gt;
  &lt;button id="filter-general"&gt;General&lt;/button&gt;
  &lt;button id="filter-rotation"&gt;Rotation&lt;/button&gt;
  &lt;button id="clear"&gt;clear&lt;/button&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>var data = [{
    "date": "2016-05-10",
    "tags": "General, Research, Rotation",
    "desc": "Nunc velit lectus, ornare vitae fringilla eget, vestibulum quis tortor."
  },{
    "date": "2016-04-22",
    "tags": "General",
    "desc": "Nunc velit lectus, ornare vitae fringilla eget, vestibulum quis tortor."
  },{
    "date": "2016-03-23",
    "tags": "Research, Rotation",
    "desc": "Nunc velit lectus, ornare vitae fringilla eget, vestibulum quis tortor."
  },{
    "date": "2015-11-01",
    "tags": "Rotation",
    "desc": "Nunc velit lectus, ornare vitae fringilla eget, vestibulum quis tortor."
  },{
    "date": "2016-08-15",
    "tags": "General, Rotation",
    "desc": "Nunc velit lectus, ornare vitae fringilla eget, vestibulum quis tortor."
  }];
  
  $(function() {
    $table = $('#table');
    $table.bootstrapTable({
      data: data
    });
  
    $('#clear').click(function() {
      $table.bootstrapTable('filterBy', {});
    });
  
    $('#filter-general').click(function() {
      $table.bootstrapTable('filterBy', {
        tags: "General"
      });
    });
  
    $('#filter-rotation').click(function() {
      $table.bootstrapTable('filterBy', {
        tags: "Rotation"
      });
    });
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/zqxwr3uL/6/" rel="nofollow">http://jsfiddle.net/zqxwr3uL/6/</a></p>
  
  <p>Edit: Either by <code>filterby</code> method or from one of the filter extensions. </p>