0

I am working with SharePoint 2013. I want to show my search results in a table view. I need this for the global search, not a webpart. I have modified ( with help from internet) the search display templates Control_searchresults into a table and modified the Default item also. The problem now is trying to call the hover panel. My code is as follows:

 <tr> <td class="ms-vb2">_#= ctx.CurrentItem.Title =#_</td> <td class="ms-vb2"><div id="_#= $htmlEncode(itemId) =#_" name="Item" data-displaytemplate="Gridview" class="ms-srch-item" onmouseover="_#= ctx.currentItem_ShowHoverPanelCallback =#_" onmouseout="_#= ctx.currentItem_HideHoverPanelCallback =#_"><div id="_#= $htmlEncode(hoverId) =#_" >Open</div></div></td> <td class="ms-vb2">_#= displaycreator=#_</td> <td class="ms-vb2">_#= fdate =#_</td> <td class="ms-vb2">_#= displayClass =#_</td> <td class="ms-vb2">_#= displayRN =#_</td> </tr> 

I am having several problems. 1) the word "Open" disappears when the hover goes away ( after the panel shows and then disappears ) 2) The formatting for the "Open" column width is too long. I know the last would be solved by using the correct ms-srch class, but I can't find them defined anywhere. I also know that the "Open" returns on a page refresh, but am at a loss. This is my first time coding any javascript. Thanks

1 Answer 1

0

I actually finally found the answer. The code should be like this:

<tr> <td class="ms-vb2">_#= ctx.CurrentItem.Title =#_</td> <td class="ms-vb2"><div id="_#= $htmlEncode(itemId) =#_" name="Item" data-displaytemplate="Gridview_TRIM" onmouseover="_#=ctx.currentItem_ShowHoverPanelCallback =#_" onmouseout="_#= ctx.currentItem_HideHoverPanelCallback =#_">Open<div id="_#= $htmlEncode(hoverId) =#_" class="ms-srch-hover-outerContainer" ></div></div></td> <td class="ms-vb2">_#= displaycreator=#_</td> <td class="ms-vb2">_#= fdate =#_</td> <td class="ms-vb2">_#= displayClassi =#_</td> <td class="ms-vb2">_#= displayRN =#_</td> </tr> 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.