I have a jQuery to display pictures as thumbnail. It works great but as soon as I add grouping to the view then the pictures do not show up as thumbnail. They show up with traditional file type icons (icjpg.gif, icpng.gif, etc.). Any idea how to fix this?
<SCRIPT type=text/javascript>
$(document).ready(function(){
$("img[src$='icjpg.gif']").each(SetImage);
$("img[src$='icpng.gif']").each(SetImage);
});
function SetImage()
{
$(this).attr('height','100');
$(this).attr('src','/it/Site/DocLib/'+$(this).attr('title'));
}
</SCRIPT>
After following this (https://sharepoint.stackexchange.com/questions/79213/run-javascript-after-group-by-in-list-has-been-clicked-on-and-list-data-loaded) article I was able to get the following code working.
<script type="text/JavaScript" src="/_layouts/jquery/jquery-1.11.0.min.js"></script>
<SCRIPT type=text/javascript>
$(document).ready(function(){
var oldExpand = ProcessImn;
ProcessImn = function(){
var results = oldExpand.apply(this, arguments);
$("img[src$='icjpg.gif'], img[src$='icpng.gif']").each(SetImage);
return results;
}
});
function SetImage()
{
//alert('line 15');
$(this).attr('height','100');
//alert('line 17');
$(this).attr('src','/it/Site/DocLib/'+$(this).attr('title'));
}
</SCRIPT>