JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › smart-grid stuck at init › Reply To: smart-grid stuck at init
I think I can use the window.Smart(element, class { properties = properties }) pattern but I need to pass an element directly, instead of a string of the element’s id there. Because my stencil’s component is already in the shadow dom, when I pass an id in a string to the first parameter of window.Smart(‘#myGridId’) it cannot be found because it is not in the dom it is in my component’s shadow dom. But I can easily get a ref to it in Stencil and I can pass that instead of the string id of it to the window.Smart() function and it will work. However, when I tried that it is saying e.indexof() is not a function and I presume it is because it is being treated as a string. Coming from a jquery background I’m sure you can recognize that sometimes it is beneficial to provide a css selector and sometimes it is easier and simpler and better to simply pass the element reference itself rather than a sizzle selector of it. I hope you will consider a feature request to pass an element instead of a string as first parameter of window.Smart().
other potential request to consider is to use smart-ui-grid without shadow mode. it can do some of the plumbing work to get the element initialized but it needs to not wrap content with shadow-dom so we can control the style. i think theming is not correctly implemented for most of shadow-dom grid anyway. it uses subcomponents like smart-grid-column which are not targeted by theme system, who uses class of .smart-grid-column (not tag of it) so the theme cannot override the background and foreground color of the grid column header with shadow on. this is a separate bug and another reason to not use shadow of smart-ui-grid.