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
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?
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.
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: