Temporarily disable grid arrowDown and arrowUp events

I have a grid with rowTemplate, inside rowTemplate component i use dropdown list or multiselect dropdown.

In the grid row open dropdown popup -> press downArrow\upArrow key.

Expected behavior:
Navigating through values in the dropdown.

Actual behavior:
Changing the active grid row and dropdown popup closes. 


Can i temporarily disable a grid arrowDown\arrowUp key events while dropdown popup is shown, so it will not change the grid row, but navigate through the dropdown values by arrowDown and arrowUp keys?

3 Replies 1 reply marked as answer

MS Manivel Sellamuthu Syncfusion Team November 5, 2020 04:47 AM UTC

Hi Andrew, 

Greetings from Syncfusion support. 

From your requirement we can understand that you want to disable the grid key configurations for up/down arrow. You can achieve your requirement by using the below suggested way. 
Please refer the below code example and sample for more information. 

<template> 
  <div id="app"> 
    <ejs-grid 
      width="auto" 
      ref="grid" 
      :dataBound="dataBound" 
      :rowTemplate="rowTemplate" 
      :pageSettings="{ pageSize: 100 }" 
      :dataSource="data" 
    > 
      <e-columns> 
        <e-column 
          field="OrderID" 
          headerText="Order ID" 
          textAlign="Right" 
          :isPrimaryKey="true" 
          width="100" 
        ></e-column> 
 
        <e-column 
          field="CustomerID" 
          headerText="Customer ID" 
          width="120" 
        ></e-column> 
      </e-columns> 
    </ejs-grid> 
  </div> 
</template> 
 
<script> 
 . . . 
 
export default { 
  data() { 
    return { 
      data: [ 
        { OrderID10248CustomerID"VINET"Numbers32532 }, 
        { OrderID10249CustomerID"TOMSP"Numbers90476 }, 
        { OrderID10250CustomerID"HANAR"Numbers94564 }, 
        { OrderID10251CustomerID"VICTE"Numbers76522 }, 
        { OrderID10252CustomerID"SUPRD"Numbers24763 }, 
      ], 
      rowTemplate: function () { 
        return { 
          template: Vue.component("rowTemplate", { 
            template: `<tr> 
     
 . . . 
        </td> 
    </tr>`, 
            data: function () { 
              return { 
                data: {}, 
              }; 
            }, 
            computed: {}, 
            methods: {}, 
          }), 
        }; 
      }, 
    }; 
  }, 
  methods: { 
    dataBound: function () { 
      //it will helps to remove the keyConfigs initially 
      this.$refs.grid.ej2Instances.keyConfigs.downArrow = ""; 
      this.$refs.grid.ej2Instances.keyConfigs.upArrow = ""; 
    }, 
  }, 
}; 
</script> 


Please let us know, if you need further assistance. 

Regards, 
Manivel 


Marked as answer

AM Andrew Mandruk February 3, 2021 05:16 PM UTC

Thank you for solution. Now everything work 


MS Manivel Sellamuthu Syncfusion Team February 4, 2021 05:13 AM UTC

Hi Andrew, 

Thanks for your update. 

We are glad to hear that the provided solution helped resolve your query. 

Please let us know, if you need further assistance. 

Regards, 
Manivel 


Loader.
Up arrow icon