jQWidgets Forums

jQuery UI Widgets Forums Grid Focus textbox after "rowdoubleclick"

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Focus textbox after "rowdoubleclick" #16406

    maxenz
    Member

    I dont know why, but i have this problem. I have a grid in a modal window. What i want is, after i doubleclick a row, close window and focus a textbox in my main page. I dont know why, but if i do this by catching “enter” event in a row, it works ok and the textbox is focused. but if i do the same job “doubleclicking a row”, the textbox is not focused. Here is my code.

    $('#popupClientes').on('close',function(event) {
    $('#txtNroAfiliado').focus();
    });
    $('#grdClientes').on('rowdoubleclick',function(event) {
    var args = event.args;
    var idxRow = args.rowindex;
    var rowData = $('#grdClientes').jqxGrid('getrowdata',idxRow);
    $('#txtCliente').val(rowData.Codigo);
    $('#popupClientes').jqxWindow('close');
    });
    $('#grdClientes').keydown(function(ev) {
    if (ev.which == 13) {
    var rowindex = $('#grdClientes').jqxGrid('getselectedrowindex');
    var rowData = $('#grdClientes').jqxGrid('getrowdata',rowindex);
    $('#txtCliente').val(rowData.Codigo);
    $('#popupClientes').jqxWindow('close');
    }
    });

    see that im doing exactly the same in “doubleclick” event and in “enter” event. And the results are different.. thanks

    Focus textbox after "rowdoubleclick" #16425

    Peter Stoev
    Keymaster

    Hi maxenz,

    Sometimes you need to call the jQuery’s “focus” method with some delay.

    Example:

    setTimeout(function()
    {
    $('#txtNroAfiliado').focus();
    }, 10);

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.