﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Wed, 27 Jun 2012 22:20:47 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;Since we are going to play with the element, there is no the exact or proper method/location such as properties. It depends on the structure. When the structure is changed the elements are also changed. You need to adjust it by using debugger and watch the current value/element.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Wed, 27 Jun 2012 14:03:45 GMT</pubDate><dc:creator>RobertB</dc:creator><description>&lt;p&gt;Ok, I did some poking and found what appears to be the solution. Making these changes allows the calling functions to remain unchanged.&lt;/p&gt;&lt;p&gt;Old (getElementsByTagName):&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;function GetHeaderCells(gridID) {
    var grid = ISGetObject(gridID);
    if (grid == null) { return null; }
    // Get parent or child WebGridRow object
    //var theTable = grid.RootTable;
    var theTable = grid.GetSelectedObject().ToRowObject().SubTable;
    return theTable.GetElement(WG40.COLHEADER, WG40.HTMLDIV).getElementsByTagName("td");
}
function GetFooterCells(gridID) {
    var grid = ISGetObject(gridID);
    if (grid == null) { return null; }
    // Get parent or child WebGridRow object
    //var theTable = grid.RootTable;
    var theTable = grid.GetSelectedObject().ToRowObject().SubTable;
    return theTable.GetElement(WG40.COLFOOTER, WG40.HTMLDIV).getElementsByTagName("tr")[1].getElementsByTagName("td");
}
&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;New (children):&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;
&lt;p /&gt;&lt;pre&gt;function GetHeaderCells(gridID) {
    var grid = ISGetObject(gridID);
    if (grid == null) { return null; }
    // Get parent or child WebGridRow object
    //var theTable = grid.RootTable;
    var theTable = grid.GetSelectedObject().ToRowObject().SubTable;
    return theTable.GetElement(WG40.COLHEADER, WG40.HTMLCELL).children[0].children[0].children;
}
function GetFooterCells(gridID) {
    var grid = ISGetObject(gridID);
    if (grid == null) { return null; }
    // Get parent or child WebGridRow object
    //var theTable = grid.RootTable;
    var theTable = grid.GetSelectedObject().ToRowObject().SubTable;
    return theTable.GetElement(WG40.COLFOOTER, WG40.HTMLCELL).children[1].children[1].children;
}
&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;Of course, I'm worried about the possiblity that I got the right answer from the wrong place, so if you could confirm that what I'm going to use is stable, I'd appreciate it.&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Wed, 27 Jun 2012 13:29:06 GMT</pubDate><dc:creator>RobertB</dc:creator><description>&lt;p&gt;That gets me the footer element, &lt;span style="text-decoration: underline; "&gt;if I know it's element 6&lt;/span&gt;.&lt;/p&gt;&lt;p&gt;How do I implement the more generic solution, where we use GetColumnIndexByName/GetHeaderCells to get the element number? It returns 8, which sends me to the wrong child.&lt;/p&gt;
&lt;p&gt;I tried getting the header info using something similar, but the direct equivalent (using WG40.COLHEADER instead of WG40.COLFOOTER) doesn't work. In fact, there isn't even a children[1].&lt;/p&gt;&lt;pre&gt;?theTable.GetElement(WG40.COLHEADER, WG40.HTMLCELL).children
{Count = 1}
    [Raw View]: {object}
    [0]: {object}
&lt;/pre&gt;
&lt;p&gt;There's also the question: if we shouldn't be using "getElementsByTagName", then why is that the only method mentioned in this thread until now? Should we be using "children" (and WG40.HTMLCELL instead of WG40.HTMLTABLE) in the original solution as well? If so, we need new equivalents for these:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;// Get grid's rows
var rows = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE).getElementsByTagName("tr");
// Get header cells
return grid.RootTable.GetElement(WG40.COLHEADER, WG40.HTMLDIV).getElementsByTagName("td");
// Get footer cells
return grid.RootTable.GetElement(WG40.COLFOOTER, WG40.HTMLDIV).getElementsByTagName("tr")[1].getElementsByTagName("td");
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Wed, 27 Jun 2012 00:07:35 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;You could not just get the div then use getElementsByTagName like that. It is not recommended because the WebGrid itself use many tables collection in there include for the footers. I would recommend you to find the correct child element manually.&lt;/p&gt;
&lt;p&gt;e.g&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;alert(theTable.GetElement(WG40.COLFOOTER, WG40.HTMLCELL).children[1].children[1].children[6].innerText);&lt;/pre&gt;
&lt;p&gt;This is the footer element I found in your structure. Please let me know if it works well on you or not.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Mon, 25 Jun 2012 11:08:55 GMT</pubDate><dc:creator>RobertB</dc:creator><description>&lt;p&gt;Sorry about that. You can remove the .js references and add this at the beginning of the &amp;lt;script&amp;gt; section:&lt;/p&gt;&lt;p /&gt;&lt;pre&gt;        function OnAfterInitialize(a, b, c, d) {
            var grid = ISGetObject(a);
            if (grid.RootTable.GetRowsCount() == 0) grid.ResetStatus(true);
        }&lt;/pre&gt;
&lt;p&gt; Thanks!&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Sun, 24 Jun 2012 21:59:46 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello Robert,&lt;/p&gt;&lt;p&gt;Where are your .js files? I noticed that it calls your .js files. I would need to have those scripts in order to get your current logic.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Fri, 22 Jun 2012 12:20:55 GMT</pubDate><dc:creator>RobertB</dc:creator><description>&lt;p&gt;I'm attaching samples that I hope will help. I think I've removed everything that won't compile outside our environment.&lt;/p&gt;&lt;p&gt;I put alert boxes at two spots in the code. One shows that we did successfully scroll through the child rows and compute a total... the other shows that the function that was supposed to return the footer row, didn't do so.&lt;/p&gt;
&lt;p&gt;Thanks a ton for your assistance! It's *so* close now!&lt;/p&gt;
&lt;p&gt;Note: Y'all might want to test the "Attach File" function with Chrome (20.0.1132.34 beta-m). I had some trouble. :)&lt;/p&gt;</description></item><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Sun, 17 Jun 2012 22:41:38 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;Please send me your runable sample. If it is possible, send along with your current structure. The elements are changed depend on your WebGrid Structure. If you want me to check it for you, it would be better if you provide me your runable sample.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Thu, 14 Jun 2012 16:26:49 GMT</pubDate><dc:creator>RobertB</dc:creator><description>&lt;p&gt;(Sorry for the delayed reply... I didn't realize I needed to turn on reply notification)&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;The suggestion for using SubTable helped a lot! I can iterate through the rows. But I can't seem to find the cell where I need to update the total.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In the snippet below, I'm able to iterate through the rows by substituting the SubTable object for the RootTable object:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;var grid = ISGetObject(gridID);
// Get parent or child WebGridRow object
//var theTable = grid.RootTable; // parent
var theTable = grid.GetSelectedObject().ToRowObject().SubTable; // child
var rows = theTable.GetElement(WG40.BODY, WG40.HTMLTABLE).getElementsByTagName("tr");
// iterate through all rows
for (var i = 0; i &amp;lt; rows.length; i&amp;#43;&amp;#43;) {
   if (rows[i].type == "Record") {
      sCellValue = grid.GetRowByElement(rows[i]).GetCell(columName).Value;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;With a similar substitution, I'm able to correctly grab the index to the header column. The GetHeaderCells function returns an array of 20 columns, and my "Percent" column is [7]:&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;headerCells = theTable.GetElement(WG40.COLHEADER, WG40.HTMLDIV).getElementsByTagName("td");&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;But something's wrong with the code that's supposed to get all the footer cells. There are only 2 elements returned by this call, and neither is my "Percent" column:&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;
&lt;p /&gt;&lt;pre&gt;footerCells = theTable.GetElement(WG40.COLFOOTER, WG40.HTMLDIV).getElementsByTagName("tr")[1].getElementsByTagName("td");&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-size: 10pt; "&gt;I suspect I need to be looking somewhere other than row index [1]... but where?&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;
&lt;p /&gt;</description></item><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Wed, 02 May 2012 02:16:55 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;You could not get the child table just using that code. You need to get SubTable first. Then, the element tag name should be available.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>WebGrid's footer not updated after client-side data is changed</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrids-footer-not-updated-after-client-side-data-is-changed/</link><pubDate>Wed, 05 May 2010 13:15:05 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;p&gt;I have a WebGrid with a footer with each column being summed via the AggregateFunction w/ "SUM". This work as expected. However, after changing the cells on the client-side, this data is not updated.&lt;/p&gt;
&lt;p&gt;I did some research and noticed the WebGrid's &lt;span style="font-size: 13px"&gt;OnExitEditMode client-side event to get the new value but I can't seem to figure out how to determine to get that updated field's column for each row in the grid as well as the underlying footer cell to update. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 13px"&gt;Is there&amp;nbsp;a way to do this without using JavaScript on the client-side? If so, can you provide an example on how do to this?&lt;/span&gt;&lt;/p&gt;</description></item></channel></rss>