Limit maximun records selected in grid detail list

Hi team ,

I have a case where is required not select more than 5 records in the list. How can prevent the section of more records in a expandable list?

expandable lixt

Like 0

Like

4 comments
const selectionState = await request.$context.DataGrid_v9rpzfx_SelectionState;
 
  const selectedIds = selectionState.selected;
 
  if (!selectedIds || selectedIds.length === 0) {
   console.log("Please select at least one record.");
    return;
  }
 
  if (selectedIds.length > 3) {
    console.log("You can select a maximum of 3 records only.");
    return;
  }

use this code sniper

Thank you Smit!

smit suthar,

Do you know if there is any way to unselect the record from the grid automatically?

Show all comments