Giter Club home page Giter Club logo

Comments (20)

bennothommo avatar bennothommo commented on May 30, 2024 1

@Trysystems I believe it is set up this way because the data table was originally built for the Builder plugin (I believe?) and that's the format it used. Since it's been like this for years, it may be difficult to make any changes to the naming without breaking implementations of this data type already out there, but we'll look into it further.

from winter.

LukeTowers avatar LukeTowers commented on May 30, 2024 1

@Trysystems could you link the PR here?

from winter.

Trysystems avatar Trysystems commented on May 30, 2024 1

wintercms/wn-test-plugin#5

from winter.

Trysystems avatar Trysystems commented on May 30, 2024

Thank you. This fix shouldn't break anything because "Report[data[1][row]]" wrong structure of field name and it can't work at all, because table.js use this name to create post data, and with wrong name data loses.

from winter.

arvislacis avatar arvislacis commented on May 30, 2024

Some backtracking information (may be useful for someone to make PR or test things) - mentioned code part which may contain problem for this issue was introduced in 970d562 as a fix for octobercms/october#4063

from winter.

arvislacis avatar arvislacis commented on May 30, 2024

In fields.yaml:

fields:
    content:
        label: Content
        type: datatable
        columns:
            field1:
                title: Code
            field2:
                title: Title
            field3:
                title: Title

2021-05-03_11-58

^ I made this just for testing purposes and works fine for me. I understand that this is not the format issue author is using but may I ask @Trysystems why you use so specific keys like data[1][row] and data[2][row] ? Can't you reduce that to similar example I mentioned?

from winter.

Trysystems avatar Trysystems commented on May 30, 2024
fields:
    content[table]:
        label: Content
        type: datatable
        columns:
            field1:
                title: Code
            field2:
                title: Title
            field3:
                title: Title

This will give you data-field-name="Model[content[table]]" attribute now. And js script cant push to server correct data, so you'll receive model[content] empty array.

from winter.

arvislacis avatar arvislacis commented on May 30, 2024

@Trysystems True but why can't you simply use content or table as the field name of datable field so you could avoid using nested name in the first place?

In my opinion field name is a field name, that's the reason why it's treated like single value. I also couldn't find any references to your mentioned cases for any other form field in https://wintercms.com/docs/backend/forms

Also make sure that you have set your datatable field as jsonable field in your model (property protected $jsonable = [];) because I assume that you would want to store all datatable data into one single text field of database row.

from winter.

bennothommo avatar bennothommo commented on May 30, 2024

@Trysystems we have examples of the data table working in the Test plugin without these changes. Are you able to demonstrate in a PR to the Test plugin an implementation that does result in data loss?

from winter.

github-actions avatar github-actions commented on May 30, 2024

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

from winter.

Trysystems avatar Trysystems commented on May 30, 2024

Still actual. The example was provided as PR to Test plugin.

from winter.

github-actions avatar github-actions commented on May 30, 2024

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

from winter.

github-actions avatar github-actions commented on May 30, 2024

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

from winter.

github-actions avatar github-actions commented on May 30, 2024

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

from winter.

github-actions avatar github-actions commented on May 30, 2024

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

from winter.

github-actions avatar github-actions commented on May 30, 2024

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days.
If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue.
If this issue is critical to your business, consider joining the Premium Support Program where a Service Level Agreement is offered.

from winter.

github-actions avatar github-actions commented on May 30, 2024

This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months.
If this issue is still relevant or you would like to see it actioned, please respond within 3 days.
If this issue is critical for your business, please reach out to us at [email protected].

from winter.

github-actions avatar github-actions commented on May 30, 2024

This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months.
If this issue is still relevant or you would like to see it actioned, please respond within 3 days.
If this issue is critical for your business, please reach out to us at [email protected].

from winter.

github-actions avatar github-actions commented on May 30, 2024

This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months.
If this issue is still relevant or you would like to see it actioned, please respond within 3 days.
If this issue is critical for your business, please reach out to us at [email protected].

from winter.

github-actions avatar github-actions commented on May 30, 2024

This issue will be closed and archived in 3 days, as there has been no activity in this issue for the last 6 months.
If this issue is still relevant or you would like to see it actioned, please respond within 3 days.
If this issue is critical for your business, please reach out to us at [email protected].

from winter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.