jQWidgets Forums

jQuery UI Widgets Forums Grid How to switch focus when multiple grids on same page?

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 9 years, 3 months ago.

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

  • yyang
    Participant

    Hi there,

    Is there any methods that we can call to lose focus from a grid?

    The issue we are facing is:
    1. Have two grids (jqxGrid1 and jqxGrid2) on the same page.
    2. Focus and select a cell ([firstName]) on jqxGrid1 after loading.
    3. When select cells from a certain column ([total]), unselect that cell from jqxGrid1, and switch focus to jqxGrid2 and select a cell ([firstName]).

    Both grids are editable using selection mode ‘multiplecellsadvanced.’ However, jqxGrid2 cannot be edited using keyboard directly without mouse focus first.

    The issue seems to be from confusing focus between these two grids. Any idea? Thanks!

    Some code snippet as below:

    $("#jqxGrid1").on('cellselect', function (event) {
       var dataField = event.args.datafield; // column data field.
       var rowBoundIndex = event.args.rowindex; // row's bound index.
    
       if (dataField == 'total') {
          $('#jqxGrid1').jqxGrid('unselectcell', rowBoundIndex, dataField);
          $('#jqxGrid1').jqxGrid({ disabled: true });
          
          $('#jqxGrid2').jqxGrid('focus');
          $('#jqxGrid2').jqxGrid('selectcell', 0, "firstName");
       }
    });

    Hristo
    Participant

    Hello yyang,

    Thank you for the interest to our Widget.
    Unfortunately you should use mouse to click on cell that you want to edit.

    Best Regards,
    Hristo Hristov

    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.