Add TextArea for each Upload File

4 posts, 0 answers
  1. Ofer
    Ofer avatar
    28 posts
    Member since:
    Jul 2019

    Posted 29 May 2020 Link to this post

    In one of my implementation of KendoReact I use the Upload component with success.

    My users want to be able to write some text to be added to each file. (instructions etc...)

    Is it possible to overload the Upload component and add a <textarea /> next to each file and have the content as a property of each file? 

    Using a "TextareaAutosize" will be even better.

    If it is not possible as is, should I suggest it as a new feature?

  2. Stefan
    Admin
    Stefan avatar
    3072 posts

    Posted 01 Jun 2020 Link to this post

    Hello, Ofer,

    We have a specific TextArea component planned for this quarter and it will have some of the TextAreaAutoSize features.

    As for the Upload, it has a custom item rendering for the file list, and we can use it to render a text area for each file:

    https://www.telerik.com/kendo-react-ui/components/upload/custom-rendering/

    If you share more details on how this should look and functions, we can provide more to the point example and/or suggest if a new feature will be required.

    Regards,
    Stefan
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  3. Ofer
    Ofer avatar
    28 posts
    Member since:
    Jul 2019

    Posted 01 Jun 2020 in reply to Stefan Link to this post

    Stefan, this can be great if I knew what to use for the default one and then add the textarea on the right of that.

    can you tell me what to enter in the "CustomListItemUI" component to simulate the out of the box UI?

    Another issue will be to have a property name for the content of the textarea content so I could use it for the save later. maybe something like file.extraText 

    If it is not possible right away, I can maybe add a useState with an array of the same length of Upload files to keep what the user's enter.

     

    Thank you.

  4. Stefan
    Admin
    Stefan avatar
    3072 posts

    Posted 02 Jun 2020 Link to this post

    Hello, Ofer,

    Currently, the CustomListItemUI expects a full custom rendering, but we can log a feature request to provide the element that we were about to render as a parameter in the function.

    Also, this is how we can attach additional data to the request and then match the text with the file by index:

    https://www.telerik.com/kendo-react-ui/components/upload/credentials/#toc-attaching-additional-data-to-requests

    Regards,
    Stefan
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top