Combined use of kendoComboBox

3 posts, 0 answers
  1. Tayger
    Tayger avatar
    61 posts
    Member since:
    Jan 2015

    Posted 06 Jun Link to this post

    Hello 

    I would like to use a kendoComboBox in a specific way. It might be easier to give you an example than describe what I want:

    The kendoComboBox has the following list to choose:
    - Enter value
    - Choice A
    - Choice B

    If the user chooses "Choice A" or "Choice B" the behaviour is as it should work in kendoComboBox: The value will be be displayed in kendoComboBox as its chosen. If the user chooses "Enter value" the input field of the kendoComboBox will be enterable and masked for only numeric values like "123". I don't want to transform the kendoComboBox into a kendoMaskedTextBox because the user must be able to choose another entry from the kendoMaskedTextBox. So I tried to use a js class to mask the kendoComboBox: http://digitalbush.com/projects/masked-input-plugin/ This javascript class works fine as long as I don't put a kendoComboBox on the input field. But as soon as the input field turns into a kendoComboBox the masked functionality is ignored. I also can live with the fact that I would make the kendoComboBox readonly after entering anything else than "Enter value". 

    To give you a better picture my code looks like this:

    $("#objectcounter").kendoComboBox({
        dataValueField: "objectCounterId",
        dataTextField: "objectCounterText",
        select: function(e) {
            // Get chosen value
            var objectCounter = this.dataItem(e.item.index()).objectCounterId;
            if (objectCounter === "value") {
               // Mask textbox on choosing "value"
                $("#c_objectcounter"+conditionNumber).mask('Z999',);
                });
            }
        },
        dataSource: activeSource["condition"+conditionNumber].objectCounter
    });

    Is there a way?

    Regards

  2. Tayger
    Tayger avatar
    61 posts
    Member since:
    Jan 2015

    Posted 06 Jun in reply to Tayger Link to this post

    Sorry, correction inside: 

    $("#objectcounter"+conditionNumber).mask('999');

    It should affect the kendoComboBox itself. 

  3. Kendo UI is VS 2017 Ready
  4. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 08 Jun Link to this post

    Hello Tayger,

    I am afraid this scenario is not supported out of the box and there is no good workaround that we can recommend. 

    Regards,
    Alexander Popov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top