Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Focusing first row in a list view

$
0
0

Hi,

I'm trying to automatically focus the first row in a list when the user enters the page.

I've been trying to programatically click the first row using jQuery (loading the script through the JSLink property on the list), but without luck. Is there a better way, or what am I missing here? Any ideas?

Here's my code:

function onPostRender(ctx) {
    $(".ms-selectitem-icon:first", $(".ms-listviewtable")).trigger("click");
}

SPClientTemplates.TemplateManager.RegisterTemplateOverrides({
    Templates: {
        OnPostRender: onPostRender
    }
});


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>