I have a data table that I am successfully adding values to an array in my model with a named action.
This is my row:
<input type="checkbox" @click.stop="namedAction ('updateAssetList', {AssetChoice: props.row.AssetID})">
This is my named action:
var AssetChoice = action.options.AssetChoice
var index = _.findIndex(model.AssetList, function(element) { return element == AssetChoice; });
if (index === -1){
model.AssetList.push(AssetChoice)
}
else{
model.AssetList.splice(index, 1)
}
This works well. My problem is that the checked checkbox depends on the row. If I check the first row on page one, when I go to the next page, it shows the first row checked. I want to be able to show the row as checked when the AssetID is in the AssetList array and not checked when not in the array. How do I do that?