Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

How to expand a row on the click of a Button?

$
0
0

I'm using the react-native-nested-list-view library.I was able to construct a tree-view but by default the expand and collapse in the tree view is done on click of the entire row. But my requirement is to expand and collapse on the click of '>' and '\/' buttons respectively. library used: "react-native-nested-listview": "^0.8.0". Please help me with this issue.

renderNestedListView = (chapter) => {
        return (
            <NestedListView
                data={chapter}
                getChildrenName={(node) => 'section'}
                onNodePressed={(node) => this.handleNodeClick(node)}
                renderNode={(node, level) => (
                    <NestedRow
                        level={level}
                        style={{ borderColor: 'black', borderWidth: 0.5 }}
                        paddingLeftIncrement={20}
                    >

                        <Text>
                            {
                                node['chapterTitle'] === undefined ? readProdDescAndCreateView(node['sectionTitle'])
                                    : node['chapterTitle']
                            }
                            {(node['section'] !== undefined
                                && Object.values(node['section']).length !== 0) && this.getExpandOrCollapse(node)}
                        </Text>
                    </NestedRow>
                )}
            />
        )

Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>