Telerik RadNumericTextBox不返回从客户端javascript设置的更新值 [英] Telerik RadNumericTextBox not returning updated value which is set from client side javascript

查看:58
本文介绍了Telerik RadNumericTextBox不返回从客户端javascript设置的更新值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Talerik Rad Grid Edit表单模板中创建了一个RadNumericTextBox,如下所示:



i have created a RadNumericTextBox inside a Talerik Rad Grid Edit form template as below:

<telerik:RadNumericTextBox ID="rdtbTPCCommissionAmount" DataType="System.Decimal"

                                                EnabledStyle-HorizontalAlign="Right" Type="Number" NumberFormat-DecimalDigits="2"

                                                ReadOnly="true" AutoPostBack="false" CssClass="amountDueWidth disableInputStyle"

                                                runat="server" NumberFormat-AllowRounding="true" Style="width: 100% !important;"

                                                Width="100%">
                                                <IncrementSettings InterceptMouseWheel="false" InterceptArrowKeys="false" />
                                            </telerik:RadNumericTextBox></pre

On a another RadNumericTextBox blur event i calling a Javascript funtion as below:

<pre lang="xml">function validateThirdPartyCommissionRate(){
               validateThirdPartyRate("<%= rgThirdPartyCommissions.ClientID %>");
           }



从上面这个函数我调用一个用JS文件编写的方法,如下面所示,并为RadNumericTextBox设置一些值:




From this above funtion i am calling a method written in JS file like below and setting some value to that RadNumericTextBox:

function validateThirdPartyRate(radGridId) {
    var grid = $find(radGridId).get_element();
    var commissionAmt = $telerik.findElement(grid, "rdtbTPCCommissionAmount");




var calculatedAmount = parseFloat(rate) * parseFloat(premiumFeeAmt) / 100;
           commissionAmt._setNewValue(calculatedAmount);
           $("#ctl00_cphMainContentPage_rgThirdPartyCommissions_ctl00_ctl07_rdtbTPCCommissionAmount").val = calculatedAmount;
           commissionAmt._value = calculatedAmount.toFixed(2);
           commissionAmt._text = calculatedAmount.toFixed(2);
           commissionAmt.value = calculatedAmount
}





我已经使用了所有不同的属性/方法来设置它们中的一些值在UI上设置值但是当我尝试在服务器端DirectCast这个控件时它给了我它的旧值而不是我从Javascript设置的更新,如上所述。





I have used all diffrent property/methods to set the value some of them are setting the value on UI but when i tried to DirectCast this control on serverside it gives me it's old value not the updated which i set from Javascript just like above.

commissionAmt = DirectCast(editedItem.FindControl("rdtbTPCCommissionAmount"), RadNumericTextBox).Text





欢迎提出修改此问题的建议吗?



So suggestion will be welcome to to fix this issue?

推荐答案

find(radGridId).get_element();
var commissionAmt =
find(radGridId).get_element(); var commissionAmt =


telerik.findElement(grid, rdtbTPCCommissionAmount);
telerik.findElement(grid, "rdtbTPCCommissionAmount");




var calculatedAmount = parseFloat(rate) * parseFloat(premiumFeeAmt) / 100;
           commissionAmt._setNewValue(calculatedAmount);


#ctl00_cphMainContentPage_rgThirdPartyCommissions_ctl00_ctl07_rdtbTPCCommissionAmount )。val = calculatedAmount;
commissionAmt._value = calculatedAmount.toFixed( 2 );
commissionAmt._text = calculatedAmount.toFixed( 2 );
commissionAmt。 value = calculatedAmount
}
("#ctl00_cphMainContentPage_rgThirdPartyCommissions_ctl00_ctl07_rdtbTPCCommissionAmount").val = calculatedAmount; commissionAmt._value = calculatedAmount.toFixed(2); commissionAmt._text = calculatedAmount.toFixed(2); commissionAmt.value = calculatedAmount }





我已经使用了所有不同的属性/方法来设置它们中的一些值在UI上设置值但是当我尝试在服务器端DirectCast这个控件时它给了我它的旧值而不是我从Javascript设置的更新,如上所述。





I have used all diffrent property/methods to set the value some of them are setting the value on UI but when i tried to DirectCast this control on serverside it gives me it's old value not the updated which i set from Javascript just like above.

commissionAmt = DirectCast(editedItem.FindControl("rdtbTPCCommissionAmount"), RadNumericTextBox).Text





欢迎提出修改此问题的建议吗?



So suggestion will be welcome to to fix this issue?


这篇关于Telerik RadNumericTextBox不返回从客户端javascript设置的更新值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆