Dynamically change currency symbol in NumericTextbox

2 posts, 0 answers
  1. Bryan
    Bryan avatar
    28 posts
    Member since:
    Oct 2014

    Posted 26 Feb 2015 Link to this post

    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.
  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 02 Mar 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top