Skip to content

Commit

Permalink
add type and link, closes #7, closes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
fgregg committed May 31, 2024
1 parent 0658d29 commit 3553641
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,27 @@
render: $.fn.dataTable.render.number(",", ".", 0, "$"),
className: "dt-body-right",
},
{ data: "type" },
{ data: "name" },
{ data: "occupation" },
{ data: "employer" },
{ data: "city_state_zip" },
{
data: "filed_doc_id",
defaultContent: "",
render: function (data, type, row, meta) {
if (type === "display") {
const encoded_doc_id = encodeURIComponent(row.filed_doc_id);
const path =
row.doc_name === "A-1"
? `A1List.aspx?FiledDocID=${encoded_doc_id}&ContributionType=wOGh3QTPfKqV2YWjeRmjTeStk426RfVK&Archived=Gl5sibpnFrQ%3d`
: row.doc_name === "Final"
? `D2Semiannual.aspx?id=${encoded_doc_id}`
: `D2Quarterly.aspx?id=${encoded_doc_id}`;
return `<a href="https://www.elections.il.gov/CampaignDisclosure/${path}">${row.filed_doc_id}</a>`;
}
},
},
],
order: [[1, "desc"]],
processing: true,
Expand All @@ -57,7 +74,7 @@
const searchInput = $("input", this.footer());
let searchTimeout;

searchInput.on("keyup change clear", function () {
searchInput.on("keyup clear", function () {
clearTimeout(searchTimeout);
searchTimeout = setTimeout(function () {
if (that.search() !== searchInput.val()) {
Expand All @@ -80,21 +97,25 @@
<th>Commitee Name</th>
<th>Received Date</th>
<th>Amount</th>
<th>Type</th>
<th>Donor Name</th>
<th>Occupation</th>
<th>Employer</th>
<th>City, State Zip</th>
<th>Filing</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Commitee Name</th>
<th>Received Date</th>
<th>Amount</th>
<th>Type</th>
<th>Donor Name</th>
<th>Occupation</th>
<th>Employer</th>
<th>City, State Zip</th>
<th>Filing</th>
</tr>
</tfoot>
</table>
Expand Down

0 comments on commit 3553641

Please sign in to comment.