Comments (4)
Custom your own renderRow and use a flag in the row data item may help.
from react-native-search-list.
@erichua23 can you give a hint how to do that? I'm stuck there as well. I have a "selected" flag that changes when the row is selected, but i noticed that the function renderRow never gets called (re-rendered) when i use forceUpdate() inside selectItem function. The only time the background of the selected row changes, is when i'm searching (keyboard opened). Is this a bug or something is missing?
from react-native-search-list.
@Phuzer Have you solved this problem? I have the same problem now.
from react-native-search-list.
It works for me
pressItem = item => {
let index = this.state.dataSource.findIndex(element => {
return element.id === item.id
})
if (index === -1) return
const { dataSource } = this.state
const data = immutable(dataSource, {
[index]: { checked: { $set: !item.checked } }
})
this.setState({ dataSource: data })
}
renderRow = (item, sectionID, rowID, highlightRowFunc, isSearching) => {
return (
<TouchableOpacity onPress={() => this.pressItem(item)}>
<View
key={rowID}
style={{
flex: 1,
marginLeft: 20,
height: rowHeight,
justifyContent: 'center',
backgroundColor: item.checked ? 'red' : 'white'
}}
>
{/* use `HighlightableText` to highlight the search result */}
<HighlightableText
matcher={item.matcher}
text={item.PerName}
textColor={'#000'}
hightlightTextColor={'#0069c0'}
/>
</View>
</TouchableOpacity>
)
}
from react-native-search-list.
Related Issues (20)
- There are not any func of Cancel ? HOT 1
- Undefined is not an object (evaluating) Proptypes.string HOT 5
- How can i implement search list with thumbnail HOT 2
- Section header not sticky in Android, Working fine in IOS
- Searching is Slow HOT 3
- How to show all alphabet instead of sort alphabet
- Styles are hardcoded...
- Hide Toolbar HOT 1
- how to give not to sort .. just use the list in the same order as applied
- Header appears while searching
- 这个可以在react中使用吗
- Pull up and down to refresh HOT 1
- Toobar中接收renderTitle参数,但是SearchList并没有传给子组件,希望加上参数
- Use 2 HighlightableTexts
- Code refactoring for deprecated components HOT 1
- TypeScript not supported
- think u meant to install standard and not standardjs
- ios Cancel out of the screen HOT 5
- FlatList compatibility HOT 2
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 react-native-search-list.