wtorek, 26 marca 2013

How to tune list view of style "Preview Pane". Part 2: no selection on page load

Another problem with the list or library view with style "Preview Pane" is that when the page loads, no item on the list is selected and as a result no field values are displayed in the table.
To correct this behaviour you need the help of javascript and jquery library.
Run SharePoint Designer and go to the view edition. You have to place these statements into the view code:

<scriptlink id="ScriptLink1" name="jquery.min.js" loadafterui="false" localizable="false" runat="server"></scriptlink>
<script type="text/javascript">
jQuery(document).ready(function () { $("div.ms-ppleft table tr td.ms-vb-title").first().trigger("onfocus"); })
</script>
The above code assumes that the jquery library file "jquery.min.js" is placed in folder C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS.

Brak komentarzy:

Prześlij komentarz