Hi,
I have an Ajax action link which GETs a partial view and insert it after a certain div on my page. That partial view contains a Kendo ComboBox which is bound to a SelectList in my model. But the ComboBox doesn't work at all when the partial has been inserted. None of the styling and functionality is there at all. In fact, all the kendo html is gone. There are no elements with the "k-combobox" and "k-widget" stuff. Everything is gone, and all I'm left with is
<input data-val="true" data-val-number="Feltet Prosjekt må være et tall." id="Sections_8fcdf2f0-53c3-45e3-9498-41aeaccf3ad4__ProjectId" name="Sections[8fcdf2f0-53c3-45e3-9498-41aeaccf3ad4].ProjectId" type="text" value="1"><script> jQuery(function(){jQuery("#Sections_8fcdf2f0-53c3-45e3-9498-41aeaccf3ad4__ProjectId").kendoComboBox({"dataSource":[{"Text":"Testprosjekt","Value":"1"},{"Text":"asd","Value":"2"},{"Text":"Ttest","Value":"3"},{"Text":"asd","Value":"4"},{"Text":"Best Project Ever","Value":"5"},{"Text":"test2000","Value":"6"},{"Text":"asdiasd","Value":"7"},{"Text":"ghghj","Value":"8"},{"Text":"sdfsd","Value":"9"},{"Text":"rtrtfgh","Value":"10"}],"dataTextField":"Text","dataValueField":"Value","placeholder":"Velg prosjekt...","suggest":true});});</script>
6 Answers, 1 is accepted
Isn't it possible to edit my post?
Anyways.. I ment to say an EditorTemplate. Not a partial.
Hello Yngve,
I am afraid the information you have provided is not sufficient to define the cause of the issue. Make sure that you have correctly fulfilled all steps explained here:
http://docs.telerik.com/aspnet-mvc/introduction#next-steps
Other useful articles:
http://docs.telerik.com/aspnet-mvc/helpers/combobox/overview#the-basics
http://docs.telerik.com/aspnet-mvc/introduction#next-steps
http://www.telerik.com/forums/how-to-add-combobox-to-editor-template-using-grid-pop-up
You could send us a sample with the code in your project so that we could examine it on our side and provide a solution.
Regards,
Joana
Progress Telerik
Hello Yngve,
The described behavior happens because the AJAX call from the Ajax.ActionLink does not evaluate JavaScript. You can read more about that here: https://stackoverflow.com/questions/1840620/asp-net-mvc-run-javascript-in-partialview-when-loaded-using-ajax-actionlink. Thus, the JavaScript logic outputted from the wrapper is never run so to.
I would suggest you implementing this by using jQuery.ajax method instead. As suggested in StackOverflow.
Regards,Ianko
Progress Telerik
