I've added Circliful stats circles to my dashboard, but now having problem with data refresh on them. The ajax refresh the data but not the circles.

Controller:

public PartialViewResult GetDailyOutput(string dateFrom, string dateTo, string line = "All")
    {
        Graph g = repository.Graphs.Where(p => p.GraphID == 2).FirstOrDefault();
        DataTable dt = repository.GetGraphData(g.StoredProc + " '" + line + "', '" + dateFrom + "', '" + dateTo + "'");
        return PartialView(dt);
    }

View:

<div id="dvDailyOutput" class="col-md-12">
    @Html.Action("GetDailyOutput", "Graph")
</div>

PartialView:

@model System.Data.DataTable

@using System.Data

foreach (DataRow row in Model.Rows)
{
            <div class="product-box col-md-3">
                @foreach (DataColumn col in Model.Columns)
        {
            if (col.ColumnName == "Product")
            {
                <div class="product-box-name col-md-2 vertical">@row[col.ColumnName]</div>
            }
            else if (col.ColumnName == "DemYield" || col.ColumnName == "FFSYield")
        {
            <div class="">
                <div class="yieldCircle" data-dimension="100" data-text="@row[col.ColumnName]%"
                     data-width="5" data-fontsize="20" data-percent="@row[col.ColumnName]" data-fgcolor="#61a9dc" data-bgcolor="#eee"></div>

            </div>
        }
        else
        {
            <div class="col-md-2">@row[col.ColumnName]</div>

        }
    }
            </div>
}

JavaScript:

<script>
var selectedLine = "All";
var dateFrom = null;
var dateTo = null;


function onCriteriaChange() {
$.post('@Url.Action("GetDailyOutput", "Graph")', { line: selectedLine, dateFrom: dateFrom, dateTo: dateTo }, function (data) {
        $("#dvDailyOutput").html(data);
    });

There are some other scripts which updates the line and dates variables, but I have omit them for clarity.

Do you know how can I redraw the circles or if not possible how can I reload partial view?

Thanks

Related posts

Recent Viewed