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

Combined use of kendoComboBox

2 Answers 102 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Tayger
Top achievements
Rank 1
Iron
Tayger asked on 06 Jun 2016, 09:58 PM

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 Answers, 1 is accepted

Sort by
0
Tayger
Top achievements
Rank 1
Iron
answered on 06 Jun 2016, 10:00 PM

Sorry, correction inside: 

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

It should affect the kendoComboBox itself. 

0
Alexander Popov
Telerik team
answered on 08 Jun 2016, 08:33 AM
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!
 
Tags
ComboBox
Asked by
Tayger
Top achievements
Rank 1
Iron
Answers by
Tayger
Top achievements
Rank 1
Iron
Alexander Popov
Telerik team
Share this question
or