This question is locked. New answers and comments are not allowed.
Dear Telerik Community,
Currently im developing a page with a grid thats also listens to ajax binding requests. This grid contains custom columns where a image is dynamicly loaded. The following code snippits will explain a little bit more.
This javascript snippit loads perfectly my grid with new fresh data. but then also the problem occurs. My image does not load but renders only a number. The following code snippit is my grid.
I thought that when i put a hyperlink that this hyperlink will be executed when i need to image, but apperently this does not happen. I have downloaded the version 2010.1.416 and have placed it in my project and works flawlessly. My project is an MVC project that is created in VS2008 with .NET Framework 3.5.
Everything works expect the loading of the image. My question is am i thinking in the right direction or should i change alot of stuff to make this work.
Kind regards,
Michiel Peeters
Currently im developing a page with a grid thats also listens to ajax binding requests. This grid contains custom columns where a image is dynamicly loaded. The following code snippits will explain a little bit more.
| <script type="text/javascript"> |
| jQuery.populateSelect = function(selectId, data) { |
| $.each(data, function() { |
| var option = new Option(this.Text, this.Value); |
| var dropdownList = $(selectId)[0]; |
| if ($.browser.msie) { |
| dropdownList.add(option); |
| } else { |
| dropdownList.add(option, null); |
| } |
| }); |
| }; |
| function initFeedbackDateFiltering() { |
| $('#feedbackDate').bind('change', function() { |
| loadGridView(); |
| }); |
| } |
| function loadGridView() { |
| var feedbackPoster = $('#feedbackPoster :selected').val(); |
| var feedbackDate = $('#feedbackDate :selected').val(); |
| var url = '/Feedback/GetFeedback/' + feedbackPoster + '?feedbackDate=' + feedbackDate; |
| var grid = $('#FeedbacksOverview').data('tGrid'); |
| if (grid != null) { |
| $.getJSON(url, function(data, textStatus) { |
| grid.dataBind(data); |
| }); |
| } |
| } |
| function initFeedbackPosterFiltering() { |
| $('#feedbackPoster').bind('change', function() { |
| var feedbackPoster = $('#feedbackPoster :selected').val(); |
| $('#feedbackDate').find('option').remove(); |
| var url = '/Feedback/GetChanges/' + feedbackPoster; |
| $.getJSON(url, function(data, textStatus) { |
| $.populateSelect('#feedbackDate', data); |
| loadGridView(); |
| }); |
| }); |
| } |
| $(document).ready(function() { |
| initFeedbackPosterFiltering(); |
| initFeedbackDateFiltering(); |
| }); |
| </script> |
This javascript snippit loads perfectly my grid with new fresh data. but then also the problem occurs. My image does not load but renders only a number. The following code snippit is my grid.
| Dim gridBuilder As Telerik.Web.Mvc.UI.Fluent.GridBuilder(Of Nexwork.ConceptManager.FeedbackController.SimpleFeedback) = Html.Telerik().Grid(Of Nexwork.ConceptManager.FeedbackController.SimpleFeedback)(ViewData("Feedbacks")) |
| gridBuilder.Name("FeedbacksOverview") |
| gridBuilder.Columns(Function(column) column.Bound(Function(model As Nexwork.ConceptManager.FeedbackController.SimpleFeedback) model.ImageId).Template(Function(model As Nexwork.ConceptManager.FeedbackController.SimpleFeedback) BaseUtilityFunctions.ResponseWriter("<a href=""" & Url.Action("ShowImage", "Image", New With {.id = model.ImageId, .sortImage = "FullImage"}) & """ onclick=""window.open(this.href); return false;"" title=""""><img src=""" & Url.Action("ShowImage", "Image", New With {.id = model.ImageId, .sortImage = "ThumbnailImage"}) & """ alt="""" /></a>")).ClientTemplate("<a href=""Image/ShowImage/<#= ImageId #>?sortImage=FullImage"" onclick=""window.open(this.href); return false;"" title="""">Klik hier<img src=""Image/ShowImage/<#= ImageId #>?sortImage=ThumbnailImage"" alt="" /></a>").Title("Afbeelding").Width(50)) |
| gridBuilder.Columns(Function(column) column.Bound(Function(model As Nexwork.ConceptManager.FeedbackController.SimpleFeedback) model.PositionInList).Title("Positie").Width(50)) |
| gridBuilder.Columns(Function(column) column.Bound(Function(model As Nexwork.ConceptManager.FeedbackController.SimpleFeedback) model.Comments).Title("Commentaar").Width(300)) |
| gridBuilder.Scrollable(Function(scroll) scroll.Enabled(True)) |
| gridBuilder.Render() |
I thought that when i put a hyperlink that this hyperlink will be executed when i need to image, but apperently this does not happen. I have downloaded the version 2010.1.416 and have placed it in my project and works flawlessly. My project is an MVC project that is created in VS2008 with .NET Framework 3.5.
Everything works expect the loading of the image. My question is am i thinking in the right direction or should i change alot of stuff to make this work.
Kind regards,
Michiel Peeters