question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select filter is showing all values as undefined

See original GitHub issue

My html

<table ng-show="!loading" show-filter="true" class="ebTable eftf ebTable_striped" ng-table="tableParams" template-pagination="custom-pager"> <tr ng-repeat="probe in $data"> <td data-title="'Host'" sortable="'host'" filter="{host: 'select'}" filter-data="fetchHosts($column)">{{probe.host}}</td>

My controller

$scope.fetchHosts = function ($column) { if($column.title() === "Host") { return [{host: "192.168.1.34"}, {host: "192.168.1.36"}]; } };

The documentation for the select filter only says that the fetchData function must return an array or a promise that returns an array etc. Despite that it fails, something is missing from the documentation i think.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
raul1991commented, Aug 2, 2016

Ok, i have got it working. The values are being shown in the dropdown now(not undefined anymore). The doc did not specify that the id and title attribute are necessary. I wish the document was more explicit. Please correct me if i am wrong in using id and title.

1reaction
aldoblackcommented, Apr 24, 2017

Thank you. The reason why I barely use ngTable, it’s because of documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to filter undefined values from Array JavaScript?
i want to filter undefined values and duplicate values from array and output in options values as selected. I would be grateful for...
Read more >
Filtering away an undefined value from a list in Ansible - Medium
I combined two Ansible (actually, jinja2) filters: select and defined . defined filter checks is value is defined or not. It returns True...
Read more >
Array.prototype.find() - JavaScript - MDN Web Docs - Mozilla
The find() method returns the first element in the provided array that satisfies the provided testing function. If no values satisfy the ...
Read more >
Remove undefined values from an array in JavaScript
An array in JavaScript permits undefined values, null values, or any type of falsy values. There are several methods to filter these values...
Read more >
Using filters to manipulate data - Ansible Documentation
Filters can help you manage missing or undefined variables by providing defaults ... You can combine data from multiple sources and types, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found