cześć
Jak odczytać/ustawić stan przeciąganego diva (np. jego ID) w widżecie Draggable (JQuery UI)?
class Test extends Component {
constructor(props) {
super(props);
this.state = {
div: null
};
}
componentDidMount() {
$("div").draggable({
drag: function(event, ui) {
var div = $(this).attr("id");
// stan: id przeciąganego diva ..... this.setState(div) ??
}
});
}
Proszę o pomoc.