I had to make some changes on the webpage i'm working, before this, i had an input textfield to filter results on a table, this was the code:
<p><input type="text" class="form-control" ng-model="search" placeholder="Search..."></p>
and the code for the table was:
<tr ng-repeat="data in someFile| filter:search | orderBy:'name'">
<td>{{data.state + ', ' + data.city}}</td>
<td> more data goes here etc...</td>
</tr>
that worked just fine, but now i need to change the input textfield for jQuery chosen select to get different info with multiple filters.
The code i tried is this:
<select data-placeholder="Search..." multiple class="control-group chosen-select" chosen id='sl_edo' style="width:200px;">
<optgroup ng-repeat="data in someFile[0].state | orderBy:'name'" label={{data.name}}>
<option value=""> </option>
<option ng-model="search" ng-repeat="city in data.city | orderBy:'name'">
{{city.name}}</option>
</optgroup>
</select>
i know that the ng-model code should go in the html select tag like this:
<select ng-model="search" data-placeholder="Search..." etc..
but that doesn't filter the results in the table, what happens is that the table goes blank, i have no idea why, unless i quit the filter the data goes back to table. What i can do to make the code work as intended?
EDIT: i have been watching what are the values in ng-model="search", so far they are treated like an array like this: ["data1","data2"...] (since i added the value={{localidad.nombre}} on the options tag), if i access to certain value in the array like this {{search[0]}}, displays the text normally like this data1, but still not filtering the table results, the table goes blank, any ideas on what's going on?
EDIT 2:i stumbled on some questions on stack overflow How to filter multiple values (OR operation) in angularJS, this could be an issue? i mean the filters are supposed to be multiple.