Skip to content

Delete row error #12

Description

@ss071109

HI,

I have a json format like :
{"type": "'', "default":'', "options": [{name:'xxx', label:'ooo',fee:100},...]}

This json in db table namely data.

In nova 4 resource, i have call JsonRepeatable class like :


$fields[] = JsonRepeatable::make('data->options')->fullWidth()
                                          ->stacked()
                                          ->rules([
                                              'array',
                                          ])
                                          ->fields([
                                              Hidden::make('name')
                                                    ->readonly(),
                                              Text::make('label')
                                                  ->rules([ 'required' ]),
                                              Number::make('fee')
                                                    ->step(0.1)
                                                    ->rules([ 'min:0', 'max:999999', 'required' ])
                                          ]);

螢幕截圖 2023-06-13 下午6 29 41

In update page, i have click a top row delete button but a last row deleted.The target row no delete.

I have view file(vendor/stepanenko3/nova-json/resources/js/components/Fields/JsonRepeatable/FormField.vue:103) function deleteRow().

螢幕截圖 2023-06-13 下午6 20 25

console.log(this.value) result is the target row deleted but display is last row deleted.

Can i know how to fix the error to display the correct information?

P.s 1 : I try to fix the error refer https://stackoverflow.com/questions/48484773/splice-not-working-properly-my-object-list-vuejs. Also not working.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions