-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble updating data from customEditor: "onUpdate is not a function" #1030
Comments
@bpraggastis, I try to pass a function into
BTW, sorry for busy day, I've no time to constructor you example with a hard work, so hope you can check your code again, and if the problem is still remain, please post a fully simple and minimal example which can let me run it quickly for reproducing this issue. Another thing is I find you give thanks |
Hi @AllenFang,
When I click the
Here is the code:
Thanks |
Please note that I was able to get the code to update the model. |
@bpraggastis, could you please confirm that you have duplicated react version in your node_modules? BTW, what's the version of your |
@AllenFang I am not sure what you mean by 'duplicated' react version in my node_modules.
|
maybe you can read JedWatson/react-select#606, please make sure it firstly, because the error said |
@AllenFang
So when I save the custom editor won't go away. Perhaps fixing the multiple versions of React will help that as well? |
When you force a update?, BTW, I think you should remove the And updateData() {
this.props.onUpdate( { contact: this.state.contact } );
} should be updateData() {
this.props.onUpdate(this.state.contact);
} |
@AllenFang thanks for your continued help on this.
I am working on pointing to a single copy of React. Maybe this will solve the problem? |
I am pointing to a single copy of React as in JedWatson/react-select#606, but I am still getting the error:
I believe the problem is that I am using Rails as per stackoverflow |
maybe, I'm not very familiar with Rails, but if this is a certainly issue for this repo, I believe it have already been opened, so just make sure that only one React in your application. Let me know if you really concern this issue is cause by this repo, thanks your hard work |
I have one column in my table which uses a customEditor. The props.defaultValue is an object 'contact' which has id and last_name fields. I created a drop down using these fields and want the user to be able to choose an item and have the id bubble back up to the table so that it will save the information to the model as it does successfully in the non custom columns. I had hoped to pass a function from the parent component into the customEditor using customEditorParameters, but when I try this I found that only strings were accepted, not methods in the customEditorParameters object.
Here is the customEditor component:
It is called from the following column:
element is created here:
When I click on the column I get the dropdown and am able to update the selected item. But when I click the save button I get the error:
Uncaught TypeError: this.props.onUpdate is not a function at ContactEditor.updateData
When I first open the contact editor I get this error:
Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs.
Would be grateful for any ideas on how to use the customEditor and bubble up the data!
Thanks
The text was updated successfully, but these errors were encountered: