最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Table data inside forms is not saving - Stack Overflow

programmeradmin0浏览0评论

I tried out a new version of Hubleto and wanted to use some of it's forms. But I later found out the data in tables inside forms is not saving.

I decided to dig around and found out the relation data (an array of objects) in the Form.tsx in the saveRecord() method is deleting itself when it's being transferred into the record variable.

The data looks similar to this:

{ 
 id: 1,
 PRODUCTS: [
  {id: 1}, 
  {id: 2}
 ]
}

It happens at this line specifically:

let record = { ...this.state.record, id: this.state.id };

Any idea of why it's happening?

I tried out a new version of Hubleto and wanted to use some of it's forms. But I later found out the data in tables inside forms is not saving.

I decided to dig around and found out the relation data (an array of objects) in the Form.tsx in the saveRecord() method is deleting itself when it's being transferred into the record variable.

The data looks similar to this:

{ 
 id: 1,
 PRODUCTS: [
  {id: 1}, 
  {id: 2}
 ]
}

It happens at this line specifically:

let record = { ...this.state.record, id: this.state.id };

Any idea of why it's happening?

Share Improve this question edited Feb 13 at 7:03 Rindo789 asked Feb 3 at 13:28 Rindo789Rindo789 214 bronze badges 3
  • 3 Please edit your question to include a minimal reproducible example so that readers can run your code to answer your question. – DarkBee Commented Feb 3 at 13:30
  • What specifically is this line of code doing that you don't expect? What does this.state contain before this line of code? What does record contain after this line of code? What different result were you expecting it to contain and why? – David Commented Feb 3 at 13:46
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Bot Commented Feb 3 at 22:14
Add a comment  | 

1 Answer 1

Reset to default 0

Most probably your form description did not contain includeRelations property. Check the Description API: https://developer.hubleto/advanced-development/description-api/form

发布评论

评论列表(0)

  1. 暂无评论