It shouldn't matter whether it enters the "each" loop or not. You're
zeroing out all the data with this section:
for (var x=0; x < anArray.length; x++)
{
anArray[x].totalPages = 0;
anArray[x].totalPassed = 0;
anArray[x].totalFailed = 0;
anArray[x].score = null;
}
Looking over the source, you are setting and testing the state of a flag to
determine whether or not you zero-out the data - what is the purpose of
this?
On Wednesday, May 28, 2014 6:24:30 PM UTC-4, TheInnovator wrote:
>
> That worked if the next entry has data.
>
> Try this,
> Enter "11/2013" for "This Month" and "10/2013" for "Last Month" and click
> Submit.
> Enter "11/2013" for "This Month" and "5/2013" for "Last Month" and click
> Submit.
>
> Because there is no data for "5/2013", it never enters the .each() loop.
>
> http://isaac.issharepoint.com/Web%20Part%20Page/508Dashboard.aspx
>
> Any ideas?
> Everything i've tried doesn't work.
>
> Thanks!
>
>
>
>
>
> On Wed, May 28, 2014 at 3:56 PM, Andrew Gallant
> <[email protected]<javascript:>
> > wrote:
>
>> You need to zero-out the values in anArray and lanArray every time you
>> return from your AJAX, like this:
>>
>> $().SPServices({
>> operation: "GetListItems",
>> async: false,
>> listName: "508 Dashboard Data",
>> CAMLViewFields: "<ViewFields><FieldRef
>> Name='Title'></FieldRef><FieldRef Name='Year'></FieldRef><FieldRef
>> Name='FileType'></FieldRef><FieldRef
>> Name='TotalFailed'></FieldRef><FieldRef
>> Name='TotalPassed'></FieldRef><FieldRef
>> Name='TotalScanned'></FieldRef><FieldRef
>> Name='score'></FieldRef></ViewFields>",
>> CAMLQuery: qry(monthWord, yearDte), //Function to call query
>> completefunc: function (xData, Status) {
>> for (var x=0; x < anArray.length; x++)
>> {
>> anArray[x].totalPages = 0;
>> anArray[x].totalPassed = 0;
>> anArray[x].totalFailed = 0;
>> anArray[x].score = null;
>> }
>> $(xData.responseXML).SPFilterNode("z:row").each(function() {
>> for (var x=0; x < anArray.length; x++)
>> {
>> var fileType = getDte($(this).attr("ows_FileType"));
>> if (fileType == anArray[x].Title)
>> {
>> anArray[x].totalPages =
>> Number($(this).attr("ows_TotalScanned"));
>> anArray[x].totalPassed =
>> Number($(this).attr("ows_TotalPassed"));
>> anArray[x].totalFailed =
>> Number($(this).attr("ows_TotalFailed"));
>> anArray[x].score =
>> Number($(this).attr("ows_TotalPassed"))/Number($(this).attr("ows_TotalScanned"));
>> x++;
>> }
>> }
>> });
>> }
>> });
>>
>>
>> On Wednesday, May 28, 2014 2:42:04 PM UTC-4, TheInnovator wrote:
>>>
>>> I have created a table using google charts.
>>> The problem that I'm having is that the table does not refresh.
>>>
>>> Enter in "10/2013" for this month and "9/2013" for last month and click
>>> submit.
>>> Now enter "8/2013" for this month and "7/2013" for last month and click
>>> submit.
>>> As you will notice, on the second set of entries, the table did not
>>> refresh.
>>>
>>> http://isaac.issharepoint.com/Web%20Part%20Page/508Dashboard.aspx
>>>
>>> Is there a table method that permits the table to refresh back to 0?
>>>
>>> Thanks
>>>
>>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Google Visualization API" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/google-visualization-api/Qs7TF3fuxo8/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected] <javascript:>.
>> To post to this group, send email to
>> [email protected]<javascript:>
>> .
>> Visit this group at
>> http://groups.google.com/group/google-visualization-api.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> -Isaac-
>
> http://twitter.com/#!/feedy0urmind
> You are today where your thoughts have brought you; you will be tomorrow
> where your thoughts take you.
> - James Allen
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.