I am starting with Lightning Web Components and I've tried to use data table. For some reason I can see data being changed in table - but in js controller my variable remain unchanged. js
import { LightningElement, track, api } from 'lwc';
import getProducts from
'@salesforce/apex/ONE_SRV_OpportunityLineItem.getAvaliableOli';
import saveProducts from '@salesforce/apex/ONE_SRV_OpportunityLineItem.saveProducts';
export default class Productsearch extends LightningElement {
@api recordId;
@track error;
@track products;
html
<lightning-datatable data={filteredProducts}
columns={columns}
selected-rows={selectedRows}
onrowselection={updateSelected}
onsave={save}
oncellchange={cellChange}
key-field="Id"
></lightning-datatable>
Any ideas why this happend?
Does anyone have good example how to do this properly?