Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #112650

    I use a checkbox selection with multiple selection.

    How can I get the selected rows indexes ?

    Tks

    #112654
    Markov
    Keymaster

    Invoke the getSelectedRowIndexes method.

    const grid = document.querySelector(‘smart-grid’);
    const result = grid.getSelectedRowIndexes();

    Best Regards,
    Markov

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

    #112655

    Tks

    I found also a metod getSelectedRowIds.

    Is there the way to declare a column ad id ?

    Tks

    #112659
    Markov
    Keymaster

    Hi,

    The column id is the ‘dataField’ property which you set to the columns.

    Best Regards,
    Markov

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

    #112663

    My data field is defined as

    {label : ‘Code’, dataField:’CODICE’, width:’auto’, align: ‘center’, width: ‘15%’, visible : true, allowEdit: false},

    Shouid I add something to make it the id or I need to add a column named id to my columns ?

    I also tried to add row.id value to each row  but it seems to ignore it.

    Tks

    #112664

    I added an id field named id.

    I defined in the DataSource keyDataField : ‘id’

    I defined it in columns as

    {label : ‘Id’, dataField:’id’, width:’auto’, align: ‘center’, width: ‘15%’, visible : true, allowEdit: false},

    I filled it.

    but getSelectedRowIds() still returns the row number of the selected rows and not my id.

    Tks

    #112666
    admin
    Keymaster

    Hi,

    To set the id of the Grid, set the id property of the dataAdapter object to the dataField you want to be used as an ID.

    Best Regards,
    Markov

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

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