deanmcpherson / deanmcpherson/react-native-sortable-listview

Is it possible to delete items from the component?

Open
#141 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
909
Forks
225
PR merge metrics
No merged PRs in 30d

Description

Im receiving the imagenesArray from a fetch im doing before all of this.
I load the images and touching the X over the image i have it gets deleted but it holds the row on the listview as it would still exists.

the 'imagenesArray' array is like this = ["www.someimageurl.com","www.someimageurl.com"]

this first screenshot is when i receive the images:
![screen shot 2018-03-02 at 12 26 32 pm](https://user-images.githubusercontent.com/26683460/36912652-61846f6a-1e15-11e8-9393-3363a32f9a34.png)

this second screenshot is when i touch the "X" icon on the image i wanna delete
![screen shot 2018-03-02 at 12 26 55 pm](https://user-images.githubusercontent.com/26683460/36912653-61ac2fb4-1e15-11e8-87a5-3bbcc22d0838.png)

`
borrarItem(index){
console.log(index)
this.state.imagenesArray.splice(index , 1)
imagenesRecibidasNuevo = this.state.imagenesArray
this.setState({imagenesArray:{}})
this.forceUpdate(); //Im trying to refresh the view but it doesnt work
Actions.refresh() //Im trying to refresh the view but it doesnt work
}

{console.log(rowData), console.log(touch),console.log(layout)}}
onRowMoved={e => {
order.splice(e.to, 0, order.splice(e.from, 1)[0]);
console.log(order)
this.forceUpdate();
}}
renderRow={(rowData, section, index) =>




{
this.borrarItem(index)
}
}
/>



}
/>
`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing borrarItem and how the SortableListView receives this.state.imagenesArray and order. Reproduce the delete action with the issue's image-array example, then verify that the deleted row disappears and the remaining list data is rendered consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.