Closed Ruzen1 closed 3 years ago
You can set disabledDrag and disabledReSorted in the data like this
this.setState({
data:[
{
disabledDrag: true,
disabledReSorted: true,
},{
disabledDrag: false,
disabledReSorted: false,
}
];
});
render() {
return (
<View style={styles.wrapper}>
<DraggableGrid
numColumns={4}
renderItem={this.render_item}
data={this.state.data}
onDragStart={this.onDragStart}
dragStartAnimation={{
transform:[
{scale:this.state.animatedValue}
],
}}
/>
</View>
);
}
disabledDrag:true
will let the item could not be drag,
disabledReSorted: true
will ignore item when resorted data
@SHISME WOW, thank you very much for your swift reply.Now I see, how to use that disabledDrag. I knew that would do the thing but was not sure how to use it.
It was so much nicer if there was any possibility to stop the whole grid at once. Anyways this shall work for me, thank you very much.
I have one other question, if you could please guide me. I thought it was css but it aint working.
Please look at this picture. Am using your library to drag. The book Facebook is actually being dragged but when I take it down, it seems as if it vanished. Anything from you is very hardly appreciated. Thank you. `
@SHISME WOW, thank you very much for your swift reply.Now I see, how to use that disabledDrag. I knew that would do the thing but was not sure how to use it.
It was so much nicer if there was any possibility to stop the whole grid at once. Anyways this shall work for me, thank you very much.
I have one other question, if you could please guide me. I thought it was css but it aint working.
Please look at this picture. Am using your library to drag. The book Facebook is actually being dragged but when I take it down, it seems as if it vanished. Anything from you is very hardly appreciated. Thank you. `
i think maybe you should set itemHeight
< DraggableGrid
itemHeight={yourItemHeight}
>
</DraggableGrid>
@SHISME Thank you for the advice. But it didnt work . I tried creating a new view outside the grid view and set the height. It did solve the problem but if there are more items, the height doesnt go dynamic resulting in incomplete grid. :/
@SHISME My bad, I solved it by setting minHeight to the device height in the view outside the grid view lol . Sorry for bothering you.
By the way, sometimes when I just start to drag it , it gets stuck. It's really sometimes. Do you know the cause for it? For example the below Toefel Test Book is stuck and cannot be dragged. However if i try again, its fine.
I am closing the issue so that it be discussed somewhere other time.
Hey am trying to disable the dragging feature after some certain conditions. Is is possible? Could anyone please guide me?