How can I set focus to the numeric text box?

9 posts, 0 answers
  1. Okosv
    Okosv avatar
    2 posts
    Member since:
    Jul 2012

    Posted 11 Jul 2012 Link to this post

    Hi All,

    How can I set focus to the kendo numerictextbox?

    via $("#controlid").focus(), $("#controlid").select()  it doesn't work.
  2. Okosv
    Okosv avatar
    2 posts
    Member since:
    Jul 2012

    Posted 12 Jul 2012 Link to this post

    up
  3. Kendo UI is VS 2017 Ready
  4. PAUL
    PAUL avatar
    36 posts
    Member since:
    Aug 2012

    Posted 20 Aug 2012 Link to this post

    Really? posted all the way back in July and still no answer? Can't figure this one out either. Thanks for the help Kendo team...
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 21 Aug 2012 Link to this post


    UPDATE (10/2012): The NumericTextBox widget now have "focus" method which should be used instead of the following solution. 

    Hello Paul,

    As you probably know, the NumericTextBox has two input elements. The one which you try to focus is hidden. In order to achieve your goal you just need to focus the visible input. Check this jsBin demo.

    As a side note, although we monitor forum threads, we do not guarantee a timely reply there. If you need a guaranteed answer in 24 hour response time, then I will suggest you open a support ticket.

     
    Kind regards,
    Georgi Krustev
    the Telerik team
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. PAUL
    PAUL avatar
    36 posts
    Member since:
    Aug 2012

    Posted 21 Aug 2012 Link to this post

    Ok thanks a lot that worked great. I could not find out how to do this simple task anywhere in the documentation...I apoligize I am new to Kendo.

  7. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 21 Aug 2012 Link to this post

    Hello Paul,

     
    In the latest internal build, we add a focus() method, which will focus the widget. It will be documented for the comming service pack (scheduled for the mid of September).

    All the best,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Saso
    Saso avatar
    8 posts
    Member since:
    Oct 2013

    Posted 25 Mar 2014 Link to this post

    is it possible to set focus to specific widget in MVVM

    template for one widget
    <div class="mvvmElement mvvmBorder" data-bind="visible: obj_priceUM.visible" style="left:40px; top:88px; width:112px; height:36px; z-index:0">
    <label class="mvvmLabel right" style="width:100%;">
    Cena za EM
    <br />
    <input data-role="numerictextbox" data-format="n2" data-decimals="2" data-spinners="false" data-bind="value: obj_priceUM.value, enabled: obj_priceUM.enabled" style="width:112px;" />
    </label>
    </div>

    videmodel 
        obj_priceUM: {
            visible: true, value: "0", enabled: true
        }

  9. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 25 Mar 2014 Link to this post

    Hello Saso,

    Currently, Kendo MVVM does not provide a focus binder. Nevertheless, you can define a custom one, which will focus the widget.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  10. Robert
    Robert avatar
    3 posts
    Member since:
    Mar 2015

    Posted 12 Sep Link to this post

    On the afterShow binding for the view, I call this code: $("#input_id").siblings("input:visible").focus();

    Also put the autofocus tag on the HTML input.  

    For the maskedTextBox, I use autofocus and $("input_id").focus() for the afterShow view event.

Back to Top
Kendo UI is VS 2017 Ready