Stump the Panel » End Users and Information Workers

Versioning and View Entries Display

(15 posts)
  • Started 1 month ago by erugalatha
  • Latest reply from Peter Allen
  1. erugalatha
    Member

    Hello.

    This may have been asked before but I couldn't find it.

    We have a list with 4 columns in it - all Comment type columns with multilines. When we turn on versioning the display of these 4 columns in the list has the "View Entries..." link displayed in each column. Because these columns contain comments we would like to show the full comments (or at least the last 5 comments). But doing this within the column is too much text in the column because it doesn't expand the column out.

    Is there a way that when we hover over the View Entries ... link that we could display the comments?

    Or maybe somebody on here has a better suggestion of how to save space but also show all the information contained behind the "View Entries ..." link?

    Thanks for you help on this.

    Posted 1 month ago #
  2. This is a twist on the calendar preview script but does exactly the same thing.

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    function handleError() { //fn needed for IE
    	return true;
    }
    function jLoadMe(t) {//load content
    	$("#jLoadMe").load(t+" [id='SPFieldNote']:eq(1)");
    }
    function initjLoadMe() {//initialize page
    	var arrayList = $("a[href$='#SPBookmark_V3Comments']");
    	$.each(arrayList, function(i,e){
    		var t = $(e).attr("href");
    		$(e).hover(function() {jLoadMe(t)});
    	});
    }
    $(function() {
    	window.onerror = handleError; //needed for IE
    	initjLoadMe();
    });
    </script>
    <div id="jLoadMe" class="content"></div>
    Posted 1 month ago #
  3. erugalatha
    Member

    It doesn't seem to fire when I hover.
    Should I load this in a CEWP same as the calendar preview?

    Posted 1 month ago #
  4. Yes. I'm using the same techniques so you need to have the div on the page where you want the content to load.

    If you want something like a hovering tooltip effect, check out jTip plugin. I haven't created one for SP yet, but it's on the list.

    Because of this, ideally you'll use the web part page template with two zones instead of the default List View page which only has one zone. If I have time next week, I'll try to make it slick-looking.

    Posted 1 month ago #
  5. erugalatha
    Member

    I think the above code is not rendering the "View Entries ..." link so the div does not get loaded.

    I'm going to give the clueTip thing a try-out. I think jTip is no longer being built upon but it seems that clueTip is the next generation of jTip.

    Here is a link to clueTip: http://plugins.jquery.com/project/cluetip/

    Posted 1 month ago #
  6. jaxkookie
    Member

    I also tried to load this code in SP 2003 and 2007. Could not get it to work. Still learning Jquery so not sure of its functionality.

    Posted 1 month ago #
  7. a[href$='#SPBookmark_V3Comments']

    This means we're looking for links with #SPBookmark_V3Comments at the end of the href attribute. If your field is not the OOB Comments field, it won't work. Since I've noticed the $= operator not working consistently, you can also try it with *=

    Posted 1 month ago #
  8. AutoSponge,

    I have tried both (a[href$='#SPBookmark_V3Comments'] and a[href$='#SPBookmark_V3Comments']) and have had no luck. But when I put in a[href*='DispForm.aspx'] it works when I mouse over the title of the item and I get the view of just the comments in CEWP.

    I am using a standard SharePoint Issues List and the link for View Entries is as follows:

    http://www.bitsofsharepoint.com/Notes/Lists/Issues/DispForm.aspx?ID=1#SPBookmark_V3Comments

    When looking at the URL for View Entries is there any issue with "?" in the URL and with what "href" pulling to compare, does it not pull after the "?"?

    Posted 1 month ago #
  9. Peter,

    The reason I wanted to use something other than DispForm in the selector is because the Title/Name column also has a link to DispForm.

    When I use the original selector on the basic Issues list it works in both browsers:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function() {
    	$("a[href$='#SPBookmark_V3Comments']").css("background-color","red")
    });
    </script>

    This just highlights the links in red. It also works with 1.3.1, the newest release. I think 1.3 got updated recently.

    Posted 1 month ago #
  10. I tested your selector script and that works great. I have tried 1.2.6, 1.3 and 1.3.1 with the preview script with no luck.

    This is strange as I had no issues with your calendar or task preview scripts.

    Posted 1 month ago #
  11. erugalatha
    Member

    Yeh, this still doesn't work for me because my list has custom columns.

    If I changed the _V3Comments to _Task _Result (the name of my columns) I think I could put 2 scripts on the page - one for each of the columns I need to modify. Nasty but it will do the job I guess.

    Posted 1 month ago #
  12. AutoSponge,

    I am really liking the JQuery solutions you have been providing. I am not very familiar with JQuery, but I am off to get some books on it. I have also been looking at the JQuery site as well.

    I did some more testing and searching on the Internet. Here is what I found:

    Your solution is working fine in Chrome. I plan to download FireFox as well.

    Since it worked fine in Chrome and I am having issues with IE 7, I believe IE 7 is not playing fair. And so I found the following on the JQuery site:

    http://docs.jquery.com/Browser_Differences

    Hope this is the issue.

    Posted 1 month ago #
  13. In further research here is what I have found:

    I have found a post talking about an issue with IE7 and the hash (#) mark with regards to JQuery. Post can be found here: http://groups.google.com/group/jquery-dev/browse_thread/thread/7868d94c942ca657/3deb0c0102f2bfcf

    I then followed a link in the post that identified that a ticket has been logged with JQuery on this. Here is the ticket: http://dev.jquery.com/ticket/3808

    I also followed the test site they have in the ticket (http://pixeline.be/experiments/jquerybeta/test2.html). I tested it out with Chrome and IE7 and it duplicated the same issue we are having with the above script. Chrome worked fine and IE7 did not work.

    I am a real novice to JQuery, got my book and reading, so I am not sure if this is the problem or what the work around or change to the code should be.

    AutoSponge, hope this helps

    Posted 1 month ago #
  14. Peter, thanks for pointing out that bug.

    We don't actually need the information after the # for this to work, so to work around the bug, we can split the url at # only using the first bit.

    Like this:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    function handleError() { //fn needed for IE
    	return true;
    }
    function jLoadMe(t) {//load content
    	$("#jLoadMe").load(t+" [id='SPFieldNote']:eq(1)");
    }
    function initjLoadMe() {//initialize page
    	var arrayList = $("a[href$='#SPBookmark_V3Comments']");
    	$.each(arrayList, function(i,e){
    		var t = $(e).attr("href").split("#");
    		$(e).hover(function() {jLoadMe(t[0])});
    	});
    }
    $(function() {
    	window.onerror = handleError; //needed for IE
    	initjLoadMe();
    });
    </script>
    <div id="jLoadMe" class="content"></div>
    Posted 1 month ago #
  15. Bingo! Now works in IE7 and still works in Chrome and Firefox.

    Thanks!!!

    Posted 1 month ago #

RSS feed for this topic

Reply

You must log in to post.