locked
Display KPI details of first target cell of scorecard by default RRS feed

  • Question

  • Hello Experts,

    I have created a Dashboard with a socrecard and KPI details next to it to read each individual KPI metrics clearly. Both of them connected by using Cell Context of Scorecard to Cell value. It works great once you select Target value  of Scorecard. No Issues et al.

    Is there any way to default to first Target cell of Scorecard when dashboard page open?. I'm searching for this a while.

    Any clues.. greatley appreciated.

    sam;)

     

     

    Tuesday, December 6, 2011 9:55 PM

Answers

  • There is no out of the box method of selecting the first cell.

    You could try looking at some jQuery code to select the first cell for you.

    You can find the Cell id (which i think remains same) by using IE developer tools and when the page is loaded call a jQuery function to select the first cell.


    http://dailyitsolutions.blogspot.com/
    Wednesday, December 7, 2011 10:29 PM

All replies

  • There is no out of the box method of selecting the first cell.

    You could try looking at some jQuery code to select the first cell for you.

    You can find the Cell id (which i think remains same) by using IE developer tools and when the page is loaded call a jQuery function to select the first cell.


    http://dailyitsolutions.blogspot.com/
    Wednesday, December 7, 2011 10:29 PM
  • Thank you Umair!.

    I've tried the same way you have mentioned. I had still difficulty in set selection on first cell. This is what I did....

    1. captured cell Id using F12 developer tools. Its guid like numbers example: "A2A9B34C09E1EA7FD6AF6830B95A499F".

    2.add content editor webpart and used add script like below.

    <script src="/Style%20Library/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>

    <script type="text/javascript">

    $("A2A9B34C09E1EA7FD6AF6830B95A499F");

    </script>

    The above jQuery should able to select the element right?.

    sam

    Thursday, December 8, 2011 9:59 PM
  • No. You would need to register the script src in master page. Here's how:

    Using jQuery with SharePoint 2010

    Then you can use the scripts in content editor webpart.


    http://dailyitsolutions.blogspot.com/
    Thursday, December 8, 2011 10:18 PM
  • Thanks Umair.

    I had added JQuery and tested with using some functions. Everything JQuery side is installed properly and works fine.

    When Add Content Editor web part just above the Scorecard and "EditHTML source" on that webpart by accessing scorecard table cell not working.

    may be I'm missing something. here is the below details

    <td tabIndex="0" class="scc scd scs" style="background-color: #fee197;" colSpan="1" sc8="2" sc15="A2A9B34C09E1EA7FD6AF6830B95A499F" sc11="false" sc24="False" sc22="False" sc23="&lt;_dd /&gt;" sc21="False" sc20="">
    <A class=bsm-Link act='[{"ClientId":"","Name":"cell","Selections":["A2A9B34C09E1EA7FD6AF6830B95A499F"]},{"ClientId":"","Name":"rm","Selections":["CE1D0B9231A99E956E49202C97829EE1"]}]' sc33="bsmval"></A>
    <DIV class=scdcc><SPAN style="WIDTH: 43px; DISPLAY: inline-block" class=scdci sc33="true">284,750 </SPAN><SPAN style="WIDTH: 12px; DISPLAY: inline-block; VERTICAL-ALIGN: middle" class=scdci><IMG class=sci border=0 alt="On Target" align=top src="/_layouts/PPSWebParts/IndicatorImage.aspx?itemUrl=%2FPPSBUILTININDICATOR%2F21_.000&amp;band=3"></SPAN><SPAN style="WIDTH: 30px; DISPLAY: inline-block" class=scdci sc33="true"> -7% </SPAN></DIV>

    The cell I'm interested on is bolded above. How do I add select on that cell in same zone content editor web part....

    This is what I'm using and

    <script type="text/javascript">
    $(document).ready(function(){
    $("A2A9B34C09E1EA7FD6AF6830B95A499F")});
    </script>

    Is this works?. can you help on this .

    Thanks

    sam

     

    Wednesday, December 14, 2011 4:41 PM
  • After much struggling I have finally managed to get this working. Here is the jQuery you would need to add to Content Editor Webpart

    <script type="text/javascript">
     setTimeout(function () {
    $("#scctrlpps_0c08fb34cd3a4a1ea4a5e9fab1732694_tv_2 td:first").trigger('click');
     }, 2000);
    </script>

    The ID you are selecting is not the correct one. You would notice that only the TR (rows) have ID. Here I am using TR ID and the first cell to trigger click.

    The setTimeout is set to 2 seconds since scorecard is load time is greater that page load (document.ready).

    Downside: I have managed to get this working only with IE 9 Document Mode. Seems to be working on all IE Versions. Does not work on Chrome will troubleshoot later.


    http://dailyitsolutions.blogspot.com/
    • Edited by Umair.Khan Friday, December 16, 2011 10:08 PM
    Friday, December 16, 2011 3:45 PM
  • Thankyou very much Umair!

    I did the same way you did but not getting any closure to what you see.

    Basically, I added content editor webpart in the same scorecard zone,  and then added below code by using "EditHTMLSource" in the Ribbon.

    <script type="text/javascript">
     setTimeout(function () {
    $("#scctrlpps_9334e137989341d2bd79449d13f33e9d_tv_2 td:first").trigger('click');
     }, 2000);
    </script>

    what I'm missing. I followed jQuery setup by your earlier posting.

    can you see off any?. appreciated your fedback umair.

    sam

     

    Monday, December 19, 2011 8:15 PM
  • Umair,

    with the above code, the error getting is:

    'originalTarget' is null or not an object.

    Did you see this before?.

    sam

    Monday, December 19, 2011 8:18 PM
  • Yes I did get that error. Which is why I pointed out that this works for "Document Mode IE9" only.

    After looking further into this issue i have found that by default Deployed dashboard page is set to be rendered using IE8 compatibility. Therefore the 'originalTarget' error.

    To bypass this error, access developer tools (F12) then on the toolbar of developer tools you will see document mode, select IE 9 Standards from list OR press Alt+9.

    Edit: Permanent fix for IE is to to modify your Master page. Locate the "meta" tag in your "<head>" section and change it to:

     <meta http-equiv="X-UA-Compatible" content="IE=9" >
    

    Save. Refresh. It should work.

    Though still not working on Chrome :(

    Reference for more understanding:

    Defining Document Compatibility


    http://dailyitsolutions.blogspot.com/



    • Edited by Umair.Khan Monday, December 19, 2011 8:58 PM
    Monday, December 19, 2011 8:56 PM
  • I saw you mentiond only on IE9 but little confused on it works all IE versions. any way I didn't have IE 9 installed. I verified on firefox and the Jquery working. as you mentioned on Chrome it's not working.

    It seems, I didn't have any options to use jQuery with my current browser IE8. right ?.

    sam

    Monday, December 19, 2011 10:24 PM
  • That is right. IE8 would not support IE9 document mode.
    http://dailyitsolutions.blogspot.com/
    Monday, December 19, 2011 10:42 PM