For the libraries, the menu ellipsis (...) is associated with the column "Name (linked to document with edit menu)" by default.
To move the ellipsis to the end of each view, you can change the order of the columns in the view to let the Name (linked to document with edit menu) display at the end of the view.
If you want to use JavaScript, you can try the script below. We can use it to add menu ellipsis (...) to a column. Refer to this demo
(function () {
// Initialize the variables for overrides objects
var overrideCtx = {};
overrideCtx.Templates = {};
// alert("Override call worked");
overrideCtx.Templates.OnPreRender = csrMenuAvail;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();
function csrMenuAvail(ctx) {
// Specifying which column you are adding the ellipsis to based on the displayed field name.
// As written this will work across multiple web parts on the same page
var numColumns = ctx.ListSchema.Field.length;
var columnArr = ctx.ListSchema.Field;
for (var i = 0; i < numColumns; i++)
{
if (columnArr[i].RealFieldName == "Title") //example 1
{
columnArr[i].listItemMenu = "TRUE";
}
}
}
It is not recommended to add scripts to master page as you only want to make it in one library.
You can use the script via JSLink. Save the above the script to a .js file such as AddMenuEellipsis.js, and upload the file to a Site library such as Site Assets library. Using code such as PowerShell to deploy the same JSLink for multiple views across the library.
Add-PSSnapin microsoft.sharepoint.powershell
$site = Get-SPSite http://sp/sites/team
$web = $site.OpenWeb()
$list = $web.Lists["doc04"]
$views = $list.views
foreach ($view in $views){
$view = $view.ServerRelativeUrl
$file = $web.GetFile($view);
$wpManager = $file.GetLimitedWebPartManager([System.Web.UI.WebControls.Webparts.PersonalizationScope]::Shared);
$webpart = $wpManager.WebParts[0]
$webpart.JSLink = "~site/SiteAssets/AddMenuEellipsis.js"
$wpManager.SaveChanges($webpart)
}