JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Data Grid Selection checkbox and height auto noisy effect.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #112708

    Ive a grid with defined ad is shown below.

    The grid has selection checboxes.

    At present the grid contains 3 rows.

    When I click on a checkbox a part of the last row seem to fall below the lower limit of the grid.

    What’s wrong ? How can I avoid this ?

    Tks
    smart-grid</span> {
    width 100%;
    height auto;

    }

    #112711
    Markov
    Keymaster

    Hi,

    If it’s necessary, set the min-height CSS prop as well.

    Regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

    #112721

    At what value ?

    The row doesn’t disappear, simply a part of the row (say 20%) alls below the grid limit.

    Tks

    #112728

    Done, but id min-height is not larger than the number of rows represented the noisy effect still reproduces.

    It seems as if the checkbox is clicked the row heigth become a little bit larger falling under the grid lower line.

    #112737
    Markov
    Keymaster

    Hi,

    The change event in Smart.Grid is triggered every time the selection changes, including when you click the same row twice.
    So when you click the same row twice, it fires twice, but both have the same payload because the grid does not internally track a “previous state” for you.

    ` const data = [
    { Name: ‘John’, Age: 30 },
    { Name: ‘Alice’, Age: 25 },
    { Name: ‘Mark’, Age: 28 }
    ];

    window.Smart(‘#grid’, class {
    get properties() {
    return {
    selection: true,
    dataSource: new Smart.DataAdapter({
    dataSource: data,
    dataFields: [
    ‘Name: string’,
    ‘Age: number’
    ]
    }),
    columns: [
    { label: ‘Name’, dataField: ‘Name’ },
    { label: ‘Age’, dataField: ‘Age’ }
    ]
    };
    }
    });

    const grid = document.querySelector(‘#grid’);

    let previousSelection = [];

    grid.addEventListener(‘change’, function (event) {
    const currentSelection = grid.getSelection();

    console.log(‘Previous:’, previousSelection);
    console.log(‘Current:’, currentSelection);

    // Compare changes
    if (JSON.stringify(previousSelection) !== JSON.stringify(currentSelection)) {
    console.log(‘Selection changed!’);
    }

    previousSelection = […currentSelection];
    });`

    Best Regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

    #112748

    Tks for Your answer but that answer was for another question i posted.

    In this post I’m asking about the noisy effect when the min-heght is lower than the space needed for all rows and the user clicks on the checkbox.

    Tks

    #112752
    Markov
    Keymaster

    Hi,

    There should be enough space for the ripple efrect to be fully shown i.e you need to set the height and min height if necessary

    Regards
    Markov

    #112754

    Fixing height to leave enough space for ripple presuppose to know how many rows we have, but owing that rows come from a query on the DB I can’t know, a priori, how many rows I’ve.

    It would be usefull to have an auto sizing of the height + some small fixed amount for the ripple effect.

    Tks

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