Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #102536
    Matias Galante
    Participant

    Hello, I’m wanting the grid to come with the first row pre selected and this is how I’ve done it programmatically so far:

    
    const id = await this.grid.getRowId(0);
    this.grid.select(id);
    

    However, the color is –smart-ui-state-selected which is a light shade of blue, is it possible to use the –smart-primary which is a dark blue? It’s the same blue color as when you click on a row?

    Thanks,
    Matias

    #102538
    Yavor Dashev
    Participant

    Hi Matias,

    There is a bit difference between using a row with the select method and when its done through user interaction and the main difference is that the user interaction set an focus attribute on the row.

    Anyway you can achieve this functionality and I have created a quick code snippet on how to achieve this:

            this.grid.select(0);
            setTimeout(() => {
                let row:any = document.querySelectorAll('smart-grid-row')[0];
                row.setAttribute('focus', '')
            }, 500);
    

    Let me know if that works for you!

    Please, do not hesitate to contact us if you have any additional questions.

    Best regards,
    Yavor Dashev
    Smart UI Team
    https://www.htmlelements.com/

    #102540
    Matias Galante
    Participant

    That worked, thank you

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.