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

[Solved] Is this possible??? topic: LoadContentFrom

2 Answers 113 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Max
Top achievements
Rank 1
Max asked on 29 Nov 2011, 06:05 AM
Hi all
I am trying to dynamically change the "contentUrl:" content after it has been created via LoadContentFrom.
The content below loads fine the FIRST time:
<div id="linkBottomGraph-region">
@{ Html.Telerik().Window()
        .Name("WindowBottomGraph")
        .Visible(false)
        .Buttons(b => b.Refresh().Maximize().Close())
        .LoadContentFrom(Url.Action("_ChartBottom", "NormalMode", new { initialDate = ViewData["initialDate"], name = ViewData["name"] }))
        .Width(1200)
        .Height(400)
        .Render();
}
</div>
The HTML results are :
jQuery('#WindowBottomGraph').tWindow({modal:false, contentUrl:'/NormalMode/_ChartBottom?initialDate=10%2F18%2F2011&name=JOHN', draggable:true, resizable:true, minHeight:250, minWidth:250, maxHeight:1500, maxWidth:1500});
Every time I click on a Master/Detail Grid the data changes and I need to use the new data and insert it into the contentUrl above since the Javascript code is "static". Not sure if that is possible. The goal is to re-create the chart using the new updated data plus display it into a new window. (sounds like mission impossible).

So, one thing I was trying to do was to use the same approach as below
function onDataBinding_Grid(e) {
    e.data = $.extend(e.data, { initialDate: initialDate, name: name });
}

I was trying to pass the same parameters to the Chart:
function onDataBinding_Chart(e) {
    e.data = $.extend(e.data, { upgradeDate: upgradeDate, vhoName: vhoName });
}


Anyways, been working on this for days.....

Thank you!

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 01 Dec 2011, 02:55 PM
Hi Max,

You can use the ajaxRequest() client-side method to reload the window content. It doesn't change the contentUrl by itself, but will request data from the server and pass any data you need:
window.ajaxRequest("/User/Details", { id: 42 });

Kind regards,
Alex Gyoshev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Max
Top achievements
Rank 1
answered on 01 Dec 2011, 04:02 PM
hey Alex, thanks for replying... I was using that but it falls into the same problem, the contentUrl cannot be changed once the Javascript code is sent to the browser.

Anyways.. thank you

Tags
General Discussions
Asked by
Max
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Max
Top achievements
Rank 1
Share this question
or