List and library control edit mode after upload

Hi
I have added list and library control to our form to upload documents to a document library. This is due to a need to have multiple documents of different category is needed to upload in the form.

I have a few queries

  1. After each upload a Field "Document Type" needs to be entered. Once the file is uploaded it the row gets disabled we have to click on the edit icon to make the row editable and the user will then make changes and click the tick box to save it.

I was just wondering if there is any way once the document is uploaded the row automatically change to edit mode?

Current state after upload

Desired out come

  1. How do i change the wording of "Upload" button to "Attach", and remove the Create folder buttons

Hello @Rinu,

I'm sorry for the late reply!

Please see the code example below. Note that this only works if one file is downloaded at a time, and the view should containing the ID column.
image

fd.spRendered(function(){

    fd.control('SPDataTable0').ready().then(function(dt) {
        //change the text
        fd.control('SPDataTable0').buttons[0].text = "Attach";
        //remove new folder button
        fd.control('SPDataTable0').buttons.splice(1,1);
    });

    fd.control('SPDataTable0').$on('filesUploaded',
        function(itemIds) {
            setTimeout(function(){ 
                //column index of ID, starting from 0
                var idColumn = 7;
                var id = itemIds[0];
                var $rows = $(fd.control('SPDataTable0').$el).find('tr');
                $rows.each(function() {
                  if($( this ).find("td:eq(" + idColumn + ")").text() == id){
                    fd.control('SPDataTable0').widget.editRow($( this ));
                  }
                }); 
            }, 1000);
        }
    );
});

Please find more details about List or Library buttons control in this post:

"Note that this only works if one file is downloaded at a time"

Thanks Mnikitha,

we will upload at least 4 files at a time, is there any way so that it will work even if its more than one upload

@Rinu,

You can't edit multiple items in List or Library control at the same time, so only one line for the uploaded document will be set to edit mode.

Sure, Thanks Mnikitina

1 Like