0

How to add a file uploader render in a dynamically added rows?

something like: enter image description here

But in dynamically added Like:

enter image description here

Let say before or after drop down and the input text field?

Best!

1 Answer 1

0

This does not fully answer my question but partially and puts it in the right direction:

I added now file uploader look like so: enter image description here

Now when I save serialised data looks like this:

{
  "_1565251449037_37": {
    "category_id": "5",
    "file_uploaded": {
      "name": "",
      "type": "",
      "tmp_name": "",
      "error": 4,
      "size": 0
    }
  },
  "_1565251729340_340": {
    "category_id": "7",
    "file_uploaded": {
      "name": "wed2b_regions_stores_v1.csv",
      "type": "text\/csv",
      "tmp_name": "\/private\/var\/tmp\/phpZwzFAH",
      "error": 0,
      "size": 10591
    }
  }
}

When it return to the page refreshed I am getting the error: enter image description here

I understand why the error is because the element is a file element button and it can't be set plus I think magento is expecting the "file_uploaded" to be string and is an object and not a string when perhaps value should be file_uploaded.name

Any help on this appreciated.

1
  • How you have fixed the error seen in the console? Commented Jun 12, 2021 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.