Comments (3)
Hi @nammiharika ,
Sorry for my late reply to this message, it would be super simple:
<NestedListView
data={data}
getChildrenName={(node) => 'items'}
onNodePressed={(node) => alert('Selected node')}
renderNode={(node, level) => (
<NestedRow
level={level}
style={styles.row}
>
<Text>{node.title}</Text>
</NestedRow>
)}
/>
the parameter node
has an attribute called opened then you can change the icon (or text) depending on this param.
I hope I could answer your question
from react-native-nested-listview.
Hi @fjmorant, thank you for your reply.
Where to give opened key in NestedListView
Here is my code...
<NestedListView data={data} getChildrenName={node => 'categories'} onNodePressed={node => console.log('Selected node11___________', node.categories.length) } renderNode={(node, level) => { // console.log('level___________', level); return ( <View style={{ flexDirection: 'row', height: 40, // backgroundColor: 'lightblue', alignItems: 'center', borderColor: 'grey', borderBottomWidth: 1, }}> <NestedRow level={level} style={{color: 'black'}}> <Text>{node.title}</Text> </NestedRow> <Image source={require('@Images/plus.png')} style={{height: 15, width: 15, marginRight: 15}} /> </View> ); }} />
After <Text>{node.title}</Text>
, try adding <Text>{node.opened ? '-':'+'}</Text>
from react-native-nested-listview.
Hi @fjmorant, thank you for your reply.
Where to give opened key in NestedListView
Here is my code...
<NestedListView
data={data}
getChildrenName={node => 'categories'}
onNodePressed={node =>
console.log('Selected node11___________', node.categories.length)
}
renderNode={(node, level) => {
// console.log('level___________', level);
return (
<View
style={{
flexDirection: 'row',
height: 40,
// backgroundColor: 'lightblue',
alignItems: 'center',
borderColor: 'grey',
borderBottomWidth: 1,
}}>
<NestedRow level={level} style={{color: 'black'}}>
<Text>{node.title}</Text>
</NestedRow>
<Image
source={require('@Images/plus.png')}
style={{height: 15, width: 15, marginRight: 15}}
/>
</View>
);
}}
/>
from react-native-nested-listview.
Related Issues (20)
- Inconsistent typescript definition for onNodePressed
- Appears to be a git repo or submodule. HOT 3
- i want dynamic height of row HOT 3
- How to search in react-native-nested-listview? HOT 2
- Fix warnings for lifecycle events HOT 1
- Remove flow dependency
- Dynamic height for each row
- Application slowed HOT 8
- `keepOpenState={true}` no effect HOT 3
- How to judge is the last level, because my data level is not fixed. HOT 3
- Rendering is slow after onNodePressed HOT 4
- Bug when use Nested-listview and Scroll View HOT 4
- Bug app HOT 2
- automatically close list view when setState parent component in v 0.11.3 HOT 5
- Cann't use with state redux HOT 3
- Render is slow when there is a lot of data HOT 6
- Export the function of render child nodes, don't render automatically HOT 1
- How to hide vertical scroll bar indicator
- onScroll event not working
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-nested-listview.