We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to disable Keyboard events for TreeGrid?

Thread ID:

Created:

Updated:

Platform:

Replies:

149902 Dec 13,2019 11:32 AM UTC Dec 16,2019 11:44 AM UTC Angular - EJ 2 1
loading
Tags: TreeGrid
Shreekumar
Asked On December 13, 2019 11:32 AM UTC

I'm using Angular Version of TreeGrid. In which, some of the rows are not grouped and when I select a row and apply a keyboard event on such rows I'm getting following error:

How to disable Keyboard events for TreeGrid?

main.0c3400941a0a4d3d3ebf.js:1 TypeError: Cannot read property 'rowIndex' of undefined
    at t.getCollapseExpandRecords (main.0c3400941a0a4d3d3ebf.js:1)
    at t.expandRow (main.0c3400941a0a4d3d3ebf.js:1)
    at t.expandCollapseAll (main.0c3400941a0a4d3d3ebf.js:1)
    at t.expandAll (main.0c3400941a0a4d3d3ebf.js:1)
    at t.treeGridkeyActionHandler (main.0c3400941a0a4d3d3ebf.js:1)
    at HTMLElement.r.keyPressHandler (main.0c3400941a0a4d3d3ebf.js:1)
    at e.invokeTask (polyfills.73b3aeabbeaddf4bfcc2.js:1)
    at Object.onInvokeTask (main.0c3400941a0a4d3d3ebf.js:1)
    at e.invokeTask (polyfills.73b3aeabbeaddf4bfcc2.js:1)
    at t.runTask (polyfills.73b3aeabbeaddf4bfcc2.js:1)



Gowri Loganathan [Syncfusion]
Replied On December 16, 2019 11:44 AM UTC

Hi Shreekumar, 

Thanks for contacting Syncfusion Support. 

Query: How to disable Keyboard events for TreeGrid? 

We have analysed your query at our end and we suggest you to give allowKeyboard:false in the load event to disable the keyboard events for TreeGrid. 

Please refer to the below code snippet:- 
 
…………… 
@Component({ 
    selector: 'app-container', 
    template: `<ejs-treegrid [dataSource]='data'  (load)='load($event)' [treeColumnIndex]='1' childMapping='subtasks'> 
                <e-columns> 
                    <e-column field='taskID' headerText='Task ID' textAlign='Right' width=70></e-column> 
                    <e-column field='taskName' headerText='Task Name' textAlign='Left' width=200></e-column> 
                    <e-column field='startDate' headerText='Start Date' textAlign='Right' format='yMd' width=90></e-column> 
                    <e-column field='duration' headerText='Duration' textAlign='Right' width=80></e-column> 
                </e-columns> 
                </ejs-treegrid>` 
}) 
.. . .  .  . .. . . . . . . 
       //Define load event// 
 
    load(args:Object){ 
        var treegrid=document.getElementsByClassName("e-treegrid")[0].ej2_instances[0]; 
        treegrid.allowKeyboard=false; 
    } 
  
} 



Kindly refer the below sample link and API link: 

Please get back to us ,if you need any further assistance on this. 

Regards,
Gowri V L. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon