mercredi 18 mars 2020

checkmark not shown when selecting a row progammatically on slickGrid

I modified the example-checkbox-row-select.html file on the examples to select a row programmatically. I added a button with the following code:

<button id="clickCheckRow" style="position:relative;height:30px">Click Check Rows</button>

and

$("#clickCheckRow").click(function() {
        let rowIndex = 5;
        selectedRowsIndexes = grid.getSelectedRows();
        selectedRowsIndexes.push(rowIndex); // add row with index 5 to selected rows indexes
        grid.updateRow(rowIndex); // update the row with index 5
        grid.invalidateRow(rowIndex); // tells that row with index 5 has changed
//            grid.invalidateRows();  // this does not work either
        grid.render(); // the invalidated rows should change, but the check mark does not show up
});

When I click the button the row gets selected, but the checkbox does not get checked.




Aucun commentaire:

Enregistrer un commentaire