I have a button "addData" , which opens modal with form inside, and a grid, on which click of row opens same model (with pre-filled valus).
My problem is, after clicking on row, when i click on "addData" button the form should be reset, but it is having previous pre-filled value.
Note that i am initializing form values with props. Whereas "addData" button is in another component(does it make any difference? because my other functionalities working totally fine).
this.props.initialize({ title: data[0].title, startdate: data[0]})
Below code is not working for me,
$(document).on("click", "#addData", function (e) {
// dispatch(reset("myformName"));
dispatch(initialize('myformName', {}));
});
It is throwing error "dispatch is not defined". What i did wrong?
How can i reset redux form in model? Can't i reset on click event of button?