Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using individual Pipes for searching and individual comumn filtering #1812

Open
maerni opened this issue Nov 15, 2024 · 0 comments
Open

Using individual Pipes for searching and individual comumn filtering #1812

maerni opened this issue Nov 15, 2024 · 0 comments
Labels
feature request Use to ask for feature request

Comments

@maerni
Copy link

maerni commented Nov 15, 2024

Hi
In our tables we have individual pipes for searching and individual column filtering.

i.e. it looks like this:

<input id="query" name="query" type="search" placeholder="Text Search" [(ngModel)]="query" />
<table>
	<thead>
		<tr>
			<th>
				<select [(ngModel)]="searchField1" id="searchField1">
					@for (field1Id of fields1; track field1Id) {<option [value]="field1Id">{{field1Id}}</option>}
				</select>
			</th>
			<th>
				<select [(ngModel)]="searchField2" id="searchField2">
					@for (field2Id of fields2; track field2Id) {<option [value]="field2Id">{{field2Id}}</option>}
				</select>
			</th>
			<th>
				<select [(ngModel)]="searchField3" id="searchField3">
					@for (field3Id of fields3; track field3Id) {<option [value]="field3Id">{{field3Id}}</option>}
				</select>
			</th>
		</tr>
		<tr>
			<th>Field 1</th>
			<th>Field 2</th>
			<th>Field 3</th>
		</tr>
	</thead>
	<tbody>
		@for (data of datas | search:query | listFilter:'field1':searchField1 | listFilter:'field2':searchField2 | listFilter: 'field3':searchField3; track data.field1) {<tr>
			<td>{{data.field1}}</td>
			<td>{{data.field2}}</td>
			<td>{{data.field3}}</td>
		</tr>}
	</tbody>
</table>

So, for the attributes field1, field2 and field3 we use an indiviual pipe (ListFilterPipe) and to search we also use an inidivudal pipe (SearchPipe).

Unfortunately I cannot find anything like this in your documentation under https://l-lin.github.io/angular-datatables/#/advanced/individual-column-filtering

Thanks very much.

Best regards
Mike

@maerni maerni added the feature request Use to ask for feature request label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Use to ask for feature request
Projects
None yet
Development

No branches or pull requests

1 participant