Hi all
Its been long break...Here i am back with little out of box solution which is not available on internet,i did the solution and felt to share it with you all so that you people do not face the issues which i faced while working with telerik mvc combobox
As we know (People who use telerik mvc combobox) that when telerik mvc combobox is used and there is huge data to be loaded from controls action method, and if AutoCompleteFilterMode is on,the combo simply hangs in IE and traditional IE error will come up saying "SCRIPT IS RUNNING INFINITE,DO YOU WANT TO STOP THE SCRIPT", and will just kill the browser
So, let us cut the story short and come up directly on solution,say you are having following combobox code
<%: Html.Telerik().ComboBoxFor(model => modelfooId)
.AutoFill(true)
.BindTo(new SelectList(Model.fooList, "Value", "Text", Model.fooId))
.HtmlAttributes(new {style = "width:400px"})
.Filterable(filtering => filtering.FilterMode(AutoCompleteFilterMode.StartsWith))
.ClientEvents(c => c.OnChange("MakeSelection").OnClose("MakeSelection"))
.HighlightFirstMatch(true)
%>
you can observe the client event registered,which is actual hack for the solution,now those javascript function is as simple as that like following
Now, try refreshing your page and try selecting any of the options, it will not hang and will run as you want
Its like magic,"Its misty until you know the trick behind"...
let me know your feedback...
Its been long break...Here i am back with little out of box solution which is not available on internet,i did the solution and felt to share it with you all so that you people do not face the issues which i faced while working with telerik mvc combobox
As we know (People who use telerik mvc combobox) that when telerik mvc combobox is used and there is huge data to be loaded from controls action method, and if AutoCompleteFilterMode is on,the combo simply hangs in IE and traditional IE error will come up saying "SCRIPT IS RUNNING INFINITE,DO YOU WANT TO STOP THE SCRIPT", and will just kill the browser
So, let us cut the story short and come up directly on solution,say you are having following combobox code
<%: Html.Telerik().ComboBoxFor(model => modelfooId)
.AutoFill(true)
.BindTo(new SelectList(Model.fooList, "Value", "Text", Model.fooId))
.HtmlAttributes(new {style = "width:400px"})
.Filterable(filtering => filtering.FilterMode(AutoCompleteFilterMode.StartsWith))
.ClientEvents(c => c.OnChange("MakeSelection").OnClose("MakeSelection"))
.HighlightFirstMatch(true)
%>
you can observe the client event registered,which is actual hack for the solution,now those javascript function is as simple as that like following
function MakeSelection(e) { $('.t-animation-container').hide(); }
Now, try refreshing your page and try selecting any of the options, it will not hang and will run as you want
Its like magic,"Its misty until you know the trick behind"...
let me know your feedback...
Comments
Post a Comment