Comments (1)
In 1133 this issue was resolve for me.
In your settings:
myColumn: {
title: 'My column title',
filter: {
type: 'list',
config: {
selectText: 'Select...',
list: [
{ value: "", title: "All"}
],
},
},
}
Only you need add this lines in the function where you get your values:
this.settings.columns.myColumn.filter.config.list.push({value: columnValue.title , title: columnValue.title});
this.settings = Object.assign({}, this.settings);
For example:
/**
* Get the rows with the service
*/
getRows(): void {
this._rowsService.getRows().subscribe(
( response ) => {
this.rows = response;
response.data.forEach( row => {
this.settings.columns.myColumn.filter.config.list.push({value: row.myColumn , title: row.myColumn});
this.settings = Object.assign({}, this.settings);
});
}
)
}
Or if the values of the column can repeat, you can use a conditional:
/**
* Get the rows with the service
*/
getRows(): void {
this._rowsService.getRows().subscribe(
( response ) => {
this.rows = response;
response.data.forEach( row => {
if( !this.settings.columns.myColumn.filter.config.list.includes(row.myColumn) ){
this.settings.columns.myColumn.filter.config.list.push({value: row.myColumn , title: row.myColumn});
this.settings = Object.assign({}, this.settings);
}
});
}
)
}
from ng2-smart-table.
Related Issues (20)
- The edit no work in the smart table, I'm using data server HOT 1
- ServerDataSource: API error Handling
- Any way to send some data to custom filter component?
- How to Make table scrollable vertically (left to right) if we are using n2-smart-table?
- How to show or hide a tag in the column tags in ng2-smart-table
- Issue while using in Angular 14 HOT 2
- Allow providing static row classes
- Access to Documentation for Old versions
- valuePrepareFunction not parsing JSON on EDIT
- How can I get the index of current page HOT 1
- Column list elements are not visible HOT 1
- Table not work when I refresh page HOT 2
- How to add CSS class to ng2-smart-table <td> ?
- How to get the row element? HOT 1
- SetFilter() and SetPaging() are not Working Properly
- I am using ng2 smart table library ad when i clicked on edit than one column is editable rest column is not editable. before click on the edit button data is displayed in the all columns but after click on that some column fields are empty. How can I resolve this issue in ng2 smart table. I am sharing my angular code.
- Support for Angular 15.x
- Is there a way to combine AND and OR operators in the setFilter function?
- Support for Angular 17.x
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-smart-table.