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 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.