How to define the values used for SearchBuilder in a dynamically created dataTable

Viewed 127

I have a table whose columns come from the DB. I'm trying to add a SearchBuilder to it, but some things aren't working quite right. For a couple of my columns, the selectable value (Foo EQUALS x), the x values that datatables automatically gives me are incorrect. In one, I have the choice of "3" or "3", and in another, a bunch of blank dropdown options (for a checkbox that is wrapped by a bit of html). Since my table is dynamically generated, I don't know the values or columns in advance. How can I specify the value of the td? There are a couples of examples in the docs using column indexes but this approach won't work for me. Is there anything like

<td :data-value="getValue(columnType, cell)"?
or
<td>
  <div class="someClass">
    <another-thing>
      <input type="checkbox" value="checked" />
...

getValue(columnType, cell) {
  if(columnType.myBusinessLogic.type === "checkbox") return cell.foo.checked;
  if(columnType.myBusinessLogic.type === "number") return parseInt(cell.bar, 10);
}

FWIW I find the docs a bit lacking and some examples are broken, so I might have missed how to do this in there.

0 Answers
Related