This is a migrated thread and some comments may be shown as answers.

get_masterTableViewFooter()

4 Answers 207 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Manjinder
Top achievements
Rank 1
Manjinder asked on 18 Nov 2008, 02:28 PM
Hi,

I'd like to be able to calculate some aggregate values and set the footer client side. 

I've got a reference to the footer object on the client using the method: get_masterTableViewFooter().

However, i can't work out how to get a reference to individual cells within this object.  Your Client API documentation doesn't seem to cover the footer object.

Can you tell me how to accomplish the following, client side:

footerItem["percentageOfTrades"].Text = TotalTradePct.ToString("N0");

Thanks



4 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 21 Nov 2008, 09:44 AM
Hi Fauchier,

You can get the HTML table element of the grid footer as follows:

var footerTable = grid.get_masterTableViewFooter().get_element(); 

Then you can iterate through the table elements in order to find the desired cell and set its innerHTML.

I hope this helps.

Best wishes,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
CodeR
Top achievements
Rank 2
answered on 13 May 2009, 05:00 AM
I keep getting a null object for 'footer' when using this phrase;

 

var grid = $find("<%= rgMySectAlerts.ClientID %>");  
var footer = grid.get_masterTableViewFooter().get_element(); 

Error: 'get_masterTableViewFooter()' is null or not an object

I have made sure that the footer is visible by setting;
ShowFooter="True"

Any clues as to what I am doing wrong?
0
Shinu
Top achievements
Rank 2
answered on 13 May 2009, 05:36 AM
Hi Damien,

The code you tried will work with Static Headers and Scrolling only. Try the following client side code for getting the footer and see whether it is working as you expected.

JavaScript:
 
<script type="text/javascript"
function getFooter() 
    var masterTable = $find("<%= RadGrid1.ClientID%>").get_masterTableView();  
    var footer = masterTable.get_element().getElementsByTagName("TFOOT")[0];  
    var col1Footer = footer.rows[0].cells[0].innerHTML// Get the footer for first column 
    footer.rows[0].cells[1].innerHTML = 'My Footer Text'// Set the footer value for second column 
    var col3Footer = footer.rows[0].cells[2].innerHTML
</script> 

Thanks,
Shinu.
0
Andrew Ross
Top achievements
Rank 1
answered on 12 Jan 2011, 08:42 PM
I'm currently working on something very similar to this, but I REALLY need to be able to access the Footer cells by ColumnName.  As, at runtime, these columns could be in any order, and i have no clue what or how many columns there will be.  What i'm doing is calculating totals on the client, and I need access to the footer, there are too many conditions to just use an aggregate, plus i need the totals updated on the client.  To go along with this, i don't want to use that StaticHeaders and I don't want to allow scrolling.

Andrew
Tags
Grid
Asked by
Manjinder
Top achievements
Rank 1
Answers by
Yavor
Telerik team
CodeR
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Andrew Ross
Top achievements
Rank 1
Share this question
or