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

Dynamically change currency symbol in NumericTextbox

1 Answer 827 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 26 Feb 2015, 09:20 PM
So, I have an input to determine a currency type and a separate input to enter an amount. I'd like to dynamically change the numerictextbox that accepts the amount to display the symbol reflected in the first input. I can specify a currency symbol fine by using a custom culture on the load of the textbox fine, ala:

var thisculture = kendo.culture();
thisculture.numberFormat.currency.symbol = '¥';

$("#salary").kendoNumericTextBox({
format: "c",
culture: thisculture,
decimals: 3,
    });

But if I bind something to the change event of the other input (a combobox in this instance), it removes the currency symbol but doesn't update it:

$('#salarycurrency).data("kendoComboBox").bind('change', function (e) {
console.log('change currency');
var selectedRows = this.select();
var dataItem = this.dataItem(selectedRows[0]);
var newculture = kendo.culture();
newculture.numberFormat.currency.symbol = '$';
$("#salary").kendoNumericTextBox().culture(newculture);
    });

Is what I'm trying to do even possible with this control? Thanks.

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 02 Mar 2015, 03:40 PM
Hi,

the only means to achieve that would be to re-instantiate the widget again.

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
NumericTextBox
Asked by
Bryan
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or