MrBliz
MrBliz

Reputation: 5918

Kendo Ui Window textbox foxus

I have a kendo window with a text box in it. On activation, the focus should be set to the textbox. the below code does that.

 $(document).ready(function () {
    if (!$("#SearchDialog").data("kendoWindow")) {
        $("#SearchDialog").kendoWindow({
            visible: false,

            resizable: false,
            modal: true,
            activate: function () {
                $("#GlobalSearch").select();
            }

        });
    }  
});

however when I apply some css in the open() function, the texbox does not get focus.

$(document).ready(function () {
    if (!$("#SearchDialog").data("kendoWindow")) {
        $("#SearchDialog").kendoWindow({
            visible: false,

            resizable: false,
            modal: true,
            activate: function () {
                $("#GlobalSearch").select();
            },
            open: function() {
                this.wrapper.css({ top: 100, width: 500, display: 'block', marginLeft: '-265px', left: '50%' });                 
            }            
        });
    }

see this fiddle for an example

Upvotes: 0

Views: 481

Answers (1)

softawareblog.com
softawareblog.com

Reputation: 990

when calling this.wrapper.css Activate event is not triggered. The best approach to set window attributes with position and width

Upvotes: 1

Related Questions