- what I am trying to accomplish
My goal is to create a column that can accommodate two numbers in order to filter numeric data within a specific range for that column. While sorting, pagination, and filtering by 'contain text' are working correctly, I'm unsure of how to implement a 'range' filter for just one column.
Visual representation of my objective
column_header1 columns_header2 column_header3 contain_filter1 contain_filter2 filter3_min_number filter3_max_number data data numeric data . . . . . . . . .
Current progress
I came across an example on the ng-table module website and attempted to integrate their code into mine, particularly focusing on implementing the range function within my 'getData'. The example I referenced: http://codepen.io/christianacca/pen/yNWeOP. I was inspired by the custom filter algorithm applied to 'age' data.
Snippet from my app.js
$http.get("http://hostname:port/variant/whole/1-10000", {cache: true}) .then(function (response) { $scope.variants = response.data; $scope.data = $scope.variants; var self = this; self.variantFilterDef = { start: { id: 'number', placeholder: 'Start' }, end: { id: 'number', placeholder: 'End' } }; // Implementing range filter with NgTableParams /* Further operational code without 'Range' functionality */ });
Snippet from my variant.html
<table ng-table="variantsTable" show-filter="true" class="table table-bordered table-striped table-condensed"> <tr ng-repeat="variant in $data"> <td data-title="'chrom'" sortable="'chrom'" filter="{ 'chrom': 'text' }" > {{variant.chrom}} </td> <td data-title="'id'" sortable="'id'" filter="{ 'id': 'text' }" > {{variant.id}} </td> <td data-title="'pos'" sortable = "'pos'" filter = "{ 'pos': 'text' }"> {{variant.pos}} </td>
I would greatly appreciate any suggestions or input on this matter. Thank you!