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

Bug in Sales Dashboard Example

2 Answers 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 18 Mar 2011, 11:00 PM
I was playing with the dashboard recently and trying to adapt it to an alternate datasource but after trying to track down a problem I was encountering I noticed that it's actually a problem in the Sales Dashboard example itself. When you click on a person's name the silverlight controls in the main content area all update based off of an employee id being access in the Javascript, but the silverlight controls don't update correctly on the first attempt.

Sales Dashboard Example

If you open up the example, you'll get metrics for the first peron in the list, Nancy. And the Representative Sales of that first pair of data points is $7,332 (first green bar). If you select the next person over (Andrew), you'll notice the Rep Sales total of that first green bar stays at $7,332, it doesn't update at all. But if you select Andrew again, it NOW updates and shows the correct value of $3,099. After playing with the code that drives this I came to the conclusion that although the content for the main panel is being updated via using AJAX, the page is not correctly updating the Id that is stored in Javascript for access by the silverlight controls.

My question is, given this problem (if I'm right) how would you fix it? I mean, aren't the examples supposed to show working demos ;-)

2 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 22 Mar 2011, 03:39 PM
Hi,

I was able to replicate the described issue. We will updated the sample application in a few days and will fix the problem.

I have updated your Telerik points as a token of gratitude.


Greetings,
Iana
the Telerik team
0
Iana Tsolova
Telerik team
answered on 07 Apr 2011, 03:45 PM
Hi Nick,

We are updating the Sales Dashboard application to Q1 2011 version of the controls. The new version of the application will be available for download the next week.
And issue was due to a client-script in the Statistics user control not evaluated properly when the control is loaded dynamically with ajax. The problematic function is:
function getChartEmployeeID()
{
    return <%= EmployeeID %>;
}

We changed the method to:
function getChartEmployeeID()
{
    return getEmployeeID();
}

And added the following code in the Default.aspx.cs file:
protected override void OnPreRenderComplete(EventArgs e)
{
    base.OnPreRenderComplete(e);
    // Make the EmployeeID available to scripts
    ScriptManager.RegisterStartupScript(Page, typeof(Page), "employeeID",
        "function getEmployeeID()   { return " + EmployeeID + "; }", true);
}



All the best,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Nick
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or