Including both the Jquery script to calculate the total of calculated column and freeze header row

Hi
I managed to get this code from here,
http://techtrainingnotes.blogspot.in/2013/03/freezing-title-row-of-sharepoint-2010.html done on the page 
I also managed to get this code from here, http://www.sharepointed.com/2012/11/28/jquery-total-calculated-column-in-sharpoint-2010/ done on another page.
However, I need this to be done on the same page. When I do this, I only get the freeze header thingy to be up and not the calculated column. Could something be blocking. 

Hi,
You take the code below for a try in your environment after modified it a bit to suit the structure of your page:
<script type="text/javascript" src="../../SiteAssets/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
// update the list after the page has loaded
_spBodyOnLoadFunctionNames.push("TTNListScroll");
function TTNListScroll()
// Scrolling list code from TechTrainingNotes.blogspot.com
// Edit the next line with your list's summary name
var SummaryName = "List28_frozenheader ";
var TTNmyTable;
var TTNListDiv = document.createElement('div');
var TTNHeadingDiv = document.createElement('div');
var tables = document.getElementsByTagName("table");
for (var i=0;i<tables.length;i++)
if(tables[i].summary == SummaryName)
TTNmyTable = tables[i];
break;
if(TTNmyTable == undefined)
// // Table not found!
// you may want to comment out the next line after testing
alert("table '" + SummaryName + "' not found");
return;
// make a copy of the table for the heading area
TTNHeadingDiv.appendChild(TTNmyTable.cloneNode(true));
TTNHeadingDiv.id="TTNheading";
TTNListDiv.appendChild(TTNmyTable.cloneNode(true));
TTNListDiv.id="TTNlist";
TTNListDiv.width="100%";
// udpate the page
var TTNnode = TTNmyTable.parentNode;
TTNnode.replaceChild(TTNHeadingDiv, TTNmyTable);
TTNnode.appendChild(TTNListDiv);
// hide the heading row of the main list
TTNListDiv.childNodes[0].rows[0].style.visibility='hidden';
// make the DIV for the heading the same width as the main list
TTNHeadingDiv.childNodes[0].style.width = TTNListDiv.childNodes[0].offsetWidth;
getSum(3);
//pass the column number to this function
function getSum(col)
var m = "$"; //change to "" for non-money format
var arrayList = $("table.ms-listviewtable:first> tbody> tr:gt(0)").find(">td:eq("+col+")");
var x = 0;
var p1 = "";
var p2 = "";
$.each(arrayList, function(){
//console.log('$(this).text(): '+$(this).text());
x += Number($(this).text().replace(/\$|,|\)/g, "").replace(/\(/g,"-"));
//console.log('x: '+x);
//format for negative numbers
if (x < 0)
p1 = "(";
p2 = ")";
x = Math.abs(x);
$('#diidSortcal').attr('visibility','visible');
$('#diidSortcal').text($('#diidSortcal').text()+'(sum: '+x+')');
function addCommas(nStr)
//formats number
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
</script>
<style type="text/css">
#TTNheading
height:28px;
#TTNlist
height:200px;
overflow-y:scroll !important;
overflow-x:auto
</style>
Then you might get something like this:
Feel free to reply if there are still any questions.
Best regards
Patrick Liang
TechNet Community Support

Similar Messages

  • Is it possible to get the total value for column and assign to other field

    hi,
    Is it possible to get the total value of particular column and assign that value to another field?
    How to do this?
    Thanks in advance,
    SAN

    Afridi,
    My extended controller class code:
    package xxhr.oracle.apps.per.selfservice.appraisals.webui;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
    import oracle.apps.per.selfservice.appraisals.webui.OverviewPageCO;
    import oracle.jbo.Row;
    public class XXOverviewPageCO extends OverviewPageCO {
    public XXOverviewPageCO() {
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.getParameter("XXCalcAvgButton")!=null){
    throw new OAException("welcome",OAException.INFORMATION);
    //getSum(pageContext, webBean);
    private String getSum(OAPageContext pageContext, OAWebBean webBean) {
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject ratvo = (OAViewObject)am.findViewObject("CompetenceElementsVO");
    OAViewObject valuevo = (OAViewObject)am.findViewObject("PerRatingLevelsVO");
    Integer Sum = new Integer("0");
    int numofRows = ratvo.getRowCount();
    for (int x = 0; x < numofRows; x++) {
    Object Rating =
    ratvo.getRowAtRangeIndex(x).getAttribute("ProficiencyLevelId");
    if(Rating!=null) {
    int numofRowsforvalue = valuevo.getRowCount();
    for(int i=0;i<numofRowsforvalue;i++){
    if(valuevo.getRowAtRangeIndex(i).getAttribute("RatingLevelId").equals(Rating)){
    Object StepValue=valuevo.getRowAtRangeIndex(i).getAttribute("StepValue");
    Sum = new Integer(StepValue.toString()) + Sum;
    OAMessageStyledTextBean displayCompAvg=(OAMessageStyledTextBean)webBean.findChildRecursive("XXCompAvgText");
    displayCompAvg.setValue(pageContext,Sum);
    return null;
    But it is not affecting in the page.
    Can you please tell me what is the problem.

  • Grand total of calculated column and case function in the same calcultd col

    Hi Gurus,
    In 9.0.4, the Grand total of the calculated column is not working as per the CASE function. It is taking the ELSE formula for all records. Is there a way to correct it.
    Thanks,
    Pooja

    Hi Pooja,
    In the totals ,which u mentioned try using cell sum function instead of sum function.
    Manikandan
    GKB Consulting Inc.,

  • Regarding passport registration issues, I need to have a letter from you including both the old and new imei numbers. Could you please send me an email mentioning that I have changed the phones with the given imei numbers?

    Regarding passport registration issues, I need to have a letter from you including both the old and new imei numbers. Could you please send me an email mentioning that I have changed the phones with the given imei numbers?

    You're not addressing Apple here. This is a user-to-user technical support forum. If you want to contact Apple, use the Contact Us link at the bottom right of every page for information on how to do so.
    Best of luck.

  • How do I set up LiveRig or TouchOSC with Mainstage 2.2.2? Both apps send signals but none are received by Mainstage and both the ipad 3 (6.1) and macbook pro (10.7.5) see each other via WIFI?

    As I said before both app's send signals but none are received by Mainstage and both the ipad 3 (6.1) and macbook pro (10.7.5) see each other via WIFI on the network set up, which I think I did right. I have tried MIDI Disigner and Mainstage shows MIDI activiti, what can I be doing wrong?
    Thanx in advance.

    I agree anti-relay can be using UBE feature. However, there is serious problem in reject the spam mail. My nms is using UBE feature to stop spam mail. According to the work flow of the UBE, the mail is received by nms completely and UBE is going to invesgate the mail address. Although UBE can stop the spam mail, the spam mail have a trouble in returning the mail to the sender. The reason is the sender address is usually not existed in the world. That will cause a lot of mail waiting in the mail queue.
    In my experience, do not use UBE for anti-relay.

  • Hi. I recently got a new computer and transferred all my files across using TimeMachine. Whenever I try to sign into any CC program (including CC) the program instantly shuts down and an Apple error message comes up. I have uninstalled and reinstalled CC

    Hi. I recently got a new computer and transferred all my files across using TimeMachine. Whenever I try to sign into any CC program (including CC) the program instantly shuts down and an Apple error message comes up. I have uninstalled and reinstalled CC twice with no avail and deleted every Adobe product on my computer and nothing is working.

    I have seen similar discussions before... transferring does not work, you must install
    Discussions of RE-installing
    -http://forums.adobe.com/thread/1408331?tstart=0
    -http://forums.adobe.com/thread/1398961?tstart=0
    -and http://helpx.adobe.com/creative-cloud/help/install-apps.html
    -using the cleaner after uninstalling and before reinstalling will usually help
    -http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html

  • I'm trying to open a 900kb Word doc (240pages) in Pages but get this error message:  Import Warning - A table was too big. Only the first 40 columns and 1,000 rows were imported.

    I'm trying to open a 900kb Word doc (240pages) in Pages but get this error message:  Import Warning - A table was too big. Only the first 40 columns and 1,000 rows were imported.

    Julian,
    Pages simply won't support a table with that many rows. If you need that many, you must use another application.
    Perhaps the originator could use a tabbed list rather than a table. That's the only way you will be able to contain a list that long in Pages. You can do the conversion yourself if you open the Word document in LibreOffice, Copy the Table, Paste the Table into Numbers, Export the Numbers doc to CSV, and import to Pages. In Pages Find and Replace the Commas with Tabs.
    There are probably other ways, but that's what comes to mind here.
    Jerry

  • How to create Remainder email workflow in share point 2010 designer without creating the remainder date (calculated) column in the list

    Hi,<o:p></o:p>
    I have task to create remainder email notification 3 days before by comparing with End
    date (my list item) so i created one calculated column in the list as remainder date by using that remainder date
    i created, but my project manager told me create same remainder notification work flow without create that remainder date i tried to write calculation in work flow
    but it is not working if any one knows how to do this please help me<o:p></o:p>
    Thanking you,<o:p></o:p>
    ArunDarly <o:p></o:p>

    Hi,
    For reminder type requirements, I tend to use the ‘Information Management Policy’ SPD method as described in
    this blog article by Laura Rogers (it’s for MOSS and WSS but works in SP2010 also).
    This method avoids the use of calculated columns; rather the workflow does the calculation and outputs information into a ‘reminder’ field. Also, I don’t like the idea of ‘paused workflows’, so this method works for me.
    Cheers
    Matt

  • How to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK?

    I am trying to figure out how to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK.

    I am trying to figure out how to get the total allocated CPUs, memory and storage in a particualr reservation through vRealize Automation Java SDK.

  • I have a question about the new version of itunes. in the old version at the bottom of the sceen it display the total number of media and the size of the files. how can i get the new version to diplay this?

    in the old version at the bottom of the sceen it displayed the total number of media and the size of the files. how can i get the new version to diplay this?

    You're welcome. It was frustrating for me as well until I stumbled across "the fix"

  • I want to know the difference between Days column and Day1 Column

    Hi All,
    I used this query:
    SELECT to_char(return_date_time,'dd/mon/yyyy hh24:mi:ss') Test,
    DECODE ('I', 'I', DECODE (1, NULL, NULL, 0, NULL, SYSDATE + 1)) Days,
    DECODE ('I', 'I', SYSDATE + 1) Day1
    FROM fm_curr_locn
    WHERE patient_id = 'DU00002765'
    output: 
    Test
    Days
    Day1
    26/oct/2013 00:00:00
    26-OCT-13
    10/26/2013 3:06:59 PM
    I want to know the difference between Days column and Day1 column and why the days column didnt show the time
    Please anyone help.....
    Regards
    Shagar M

    Pleiadian wrote:
    It is the decode statement that is doing this.
    The format of decode is:
    decode(expression, search1, result1, search2, result2, searchn, resultn, default)
    All result fields must be of the same datatype and will be of the datatype of the first result (result1 in this example)
    In your example (the decode for the field Days) the first result is a NULL. I suspect (gurus? anyone?) that Oracle will use the varchar2 overload of the decode statement, and the date field will be converted to varchar2 using your NLS_DATE_FORMAT settings.
    In the second decode statment (Day1) the first result is of datatype date, so the result of the decode statement will be a date field (and will be parsed as such by your sql development tool)
    I agree, as NULL is the first result returned the datatype is undetermined, so Oracle is picking VARCHAR2 over others, and causing an implicit datatype conversion on the resultant date value, whereas the other which is returned as a date will use the local settings of the client tool being used.
    I can replicate the 'issue' in Toad, and it's rectified if we cast the first returned value of the decode statement...
    SELECT DECODE ('I', 'I', DECODE (1, NULL, CAST(NULL AS DATE), 0, NULL, SYSDATE + 1)) Days,
           DECODE ('I', 'I', SYSDATE + 1) Day1
    FROM dual

  • Hw to Get the number of table columns and their name in procedure ?

    Friends,
    I have to write some procedure. In this procedure, I want to get the total number of columns in a table. Also I want the column names for that table.
    I have a requirement that I need to add column in the table dynamically in some cases. Later I want the name of that added column.
    Thanks in advance,
    Nirav

    I want to get the total number of columns in a table. Also I want the column
    names for that table
    SQL> select column_name from user_tab_cols where table_name = 'EMP';
    COLUMN_NAME
    EMPNO
    ENAME
    JOB
    MGR
    HIREDATE
    SAL
    COMM
    DEPTNO
    8 rows selected.
    I have a requirement that I need to add column in the table dynamically in some
    casesWhy ??
    Rgds.

  • Is there a way I can have my form calculate a total time from beginning and ending time?

    Is there a way I can have my form calculate a total time from beginning and ending time?

    Sorry, but Formscentral doesn't support either a timer function or any kind of calculation. You might be able to do this if created your form in PDF. For help with PDF form creation in Acrobat I suggest you repost your question to the Acrobat Forum.
    Andrew

  • Calculate percrentage based on 2 column and one filter

    Hi,
    I am looking for a way to compute percentage based one two column and 1 filter but i have a problem when every thing is checked on my filter.
    The table as follow is my example:
    ID
    cat1
    cat2
    number
    total
    pct
    1
    a
    aa
    5
    40
    13%
    1
    a
    ab
    20
    40
    50%
    1
    a
    ac
    15
    40
    38%
    1
    b
    ba
    12
    47
    26%
    1
    b
    bb
    20
    47
    43%
    1
    b
    bc
    15
    47
    32%
    2
    a
    aa
    9
    45
    20%
    2
    a
    ab
    16
    45
    36%
    2
    a
    ac
    20
    45
    44%
    2
    b
    ba
    10
    50
    20%
    2
    b
    bb
    20
    50
    40%
    2
    b
    bc
    20
    50
    40%
    I create a power table as follow:
    Filter: column ID
    Axis: cat1 and cat2
    values: pct
    The problem is when I want to select all my data in my filter, a sum/mean is done for pct but the results are wrong. Did I missed something ? Is there a way to correct the problem ?

    Hi mi jo,
    It appears that you have created your percentage as a Calculated Column and what you actually want is a Calculated Field.
    You can create a Calculated Field by clicking on the Power Pivot ribbon and using a DAX formula similar to the following:
    Percentage:=DIVIDE(SUM(TableName[number]), SUM(TableName[total]))
    I have formatted this Calculated Field as a percentage and used it to create a Pivot Table:
    Is this what you were after or have I misunderstood the problem?
    Edit: Just took a quick look at the workbook and can see that the pct column is coming in as a fixed value for a row. The above solution should help. A best practice would be to first create a Calculated Field for each of the number and
    total columns such as...
    Sum of Number:=Sum(TableName[number])
    And...
    Sum of Total:=Sum(TableName[total])
    And then finally update this DAX formula:
    Percentage:=DIVIDE(SUM(TableName[number]), SUM(TableName[total]))
    To this...
    Percentage:=DIVIDE([Sum of Number], [Sum of Total])
    Regards,
    Michael Amadi
    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
    Website: http://www.nimblelearn.com
    Blog: http://www.nimblelearn.com/blog
    Twitter: @nimblelearn

  • PO Condition type to be included in the total amount of PO

    Hi,
    I have a PO conditiont type configured with the ff. attributes:
    1. Condition Class is Discount or surcharge.
    2. Calculation type is percentage.
    3. Cond. category is delivery costs.
    I want to include the additional cost of this condition in the total amount of the PO. How will I configure the condition type to behave this way?

    Hi,
    Go to SPRO- MM - Purchasing - Conditions - Define Price determination Process - Define calculation schema
    Select the pricing procedure and go to the control data add the new condition type that you have configured as an additional step in the pricing procedure before the total amount.
    Regards
    Merwyn

Maybe you are looking for

  • Problem with facetime for mac

    hello guy! I've got a problem with facetime for mac.My sister has a I-pod touch fourth generation with factime but i cna't phone her a message come on my mac.It say "xxx can't receive facetime's calls"!Can you help me??

  • How do I switch my 3G account from one iPad to another iPad?

    I have an iPad 2 with the 1GB Verizon 3G service. I have to send it in for a replacement model due to a hardware error. What do I need to do to get my 3G service running on the new iPad? Do I need to call Verizon and cancel or wait until I have the n

  • Tecra M2 - Will not boot up, power light is on

    Hi, I wonder if someone out there could help me with a problem? I was using my M2 on Friday when my friend accidentally knocked a very small amount of soft drink onto the front of my M2, I immediately put it upright and got a hairdryer on it. After l

  • Cat TimesheetData dropdown doesn't refresh

    Hi Expert, In Cat WD application , we have a cell Absence use dynamic dropdown UI. when we click on the calendar, the timesheet data is refreshed, but not the dropdown list. Any idea ? thanks. Ben.J.

  • Itunes got erased, can i transfer from Ipod back into itunes?

    Greetings, I did an update to my Apple and all of my itunes and iphoto got erased. The songs are still listed but there are exclamations next to each song and they wont play. I didnt have it backed up in time machine because i didnt realize i had to