I have created a number of search forms and would like to suppress the name and hits columns if possible. I have seen answers related to this for earlier versions of WebLink, but nothing specific to v9 - I have attempted the suggestions and the page fails with the suggested code. Any help is appreciated. Thanks, Wendy
Question
Question
Replies
It appears that the NAME and HITS column are always on by default so I am not sure if you would be able to hide this column through modifying the control. However, you can do this through jQuery which I have included below:
$('td:nth-child(COLUMNNUMBERHERE)').hide();
The COLUMNNUMBERHERE should be changed the order number of the column you wish to hide. For example if the NAME column is the first one that appears on the table then it should be:
$('td:nth-child(1)').hide();
For multiple columns, such as the one you are requesting, you would need to separate each column by using a comma (using NAME as the first column and HITS as the fifth column):
$('td:nth-child(1),td:nth-child(5)').hide();
The is jQuery should be added to the bottom of the CustomSearch.aspx page right before the closing </body> tag:
<script type="text/javascript"> $('td:nth-child(1), td:nth-child(5)').hide(); </script> </body>
Once you have added it, save the page and run your query again.This has been tested in WebLink 9 and works as expected.
Hope this helps!
Thanks - I should have added one piece of information - I am using the grid view for results - which I think this does not address unfortunately.
Wendy this code provided is specifically for the Grid View results.
Hi Wes - when I put the code in - the actual search form changed - I don't even get a chance to submit
I have attached a doc with before and after screen shots
I believe I have the code entered in the proper location in the aspx - it is an elegant solution
I am moving the javascript around a bit and getting different results - I will keep at it, thanks again!!
Wendy
Wendy, try the following as I have updated to reference the results table explicitly;
$('.SearchResultsBrowserDisplayTable td:nth-child(1),.SearchResultsBrowserDisplayTable td:nth-child(2)').hide();
Remember to update the index numbers to match yours (I do believe though by default that the NAME and HITS columns are 1 and 2 just as displayed above in the code.
Of course! As I said elegant!
Thanks Wes - works like a champ!! Appreciate the assistance.