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

[Solved] NumericTextBox in ajax partial view scenarios

1 Answer 53 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Matt Hidinger
Top achievements
Rank 1
Matt Hidinger asked on 23 Mar 2010, 03:49 PM
I have a bunch of NumbericTextBoxes in a partial view, which work fine on initial page load.

However, when I submit the form they are in via Ajax (jQuery ajaxForm plugin) and reload the partial view, the textboxes are returned as plain textboxes. Typically, I need to re-process any client side initiation at the end of every ajax request, but I cannot find the correct javascript method to turn the Telerik NumericTextboxes back into the advanced form.

My Partial View looks like this:
<%= Html.Telerik().CurrencyTextBox()  
    .Name(ViewData.TemplateInfo.HtmlFieldPrefix)  
    .MinValue(0)  
    .MaxValue(10000000)  
    .Value(Model)  
      
%> 

And my page is using the following logic to submit the form via ajax
 $('#communityFinancialDetailsForm').ajaxForm({  
                success: function (html) {  
                    $('#communityFinancialDetailsForm').html(html);  
                }  
            }); 

The problem is that the snippet is returning the HTML elements (the currency <input> fields) but not executing the jQuery init logic to enhance their functionality with currency logic.

Please let me know if any additional details will help.

Thanks,
Matt

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 24 Mar 2010, 09:21 AM
Hi Matt Hidinger,

Normally all UI components will output the required JavaScript initialization code after Ajax request. This is shown in the checkboxes grid example. You can inspect the output using a sniffer tool to see if this happens in your case. Perhaps something in the ajaxform plugin is preventing the components from outputting the JavaScript. The html jquery method normally executes all JavaScript which is part of the contents. Additionally you can check this help article which shows how to load Telerik UI components from Ajax.

Regards,
Atanas Korchev
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
NumericTextBox
Asked by
Matt Hidinger
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or