adaptiveDlgTarget in hooks

Hi,

I read this sample https://ej2.syncfusion.com/react/documentation/grid/adaptive/, but I need use with hooks

const load = () => {
grid.adaptiveDlgTarget = document.getElementsByClassName(
'e-mobile-content',
)[0];
};


the "adaptiveDlgTarget" is undefined and grid variable is "{current: null}"

thx for your help.




1 Reply

RS Rajapandiyan Settu Syncfusion Team August 13, 2021 12:09 PM UTC

Hi Oscar, 
 
Thanks for contacting Syncfusion support. 

We validated your requirement at our end. You can resolve this by using following code example in the load event of Grid. 
 
 
 
[index.js] 
 
 
  load() { 
    // get the Grid instances from its element 
    var grid = document.getElementById('adaptivebrowser').ej2_instances[0]; 
    // bind the property as you want 
    grid.adaptiveDlgTarget = document.getElementsByClassName('e-mobile-content')[0]; 
  } 
 
 
 
 
Please get back to us if you need further assistance with this. 
 
Regards, 
Rajapandiyan S 


Loader.
Up arrow icon