@using MP.SPEC.Data @code { [Parameter] public List? AllRecords { get; set; } = null; [Parameter] public EventCallback EC_Close { get; set; } [Parameter] public EventCallback EC_ReqAdd { get; set; } private int numRecord = 5; private int totalCount = 0; private int currPage = 1; private bool isLoading = false; private List? ListRecords; protected override void OnParametersSet() { numRecord = 10; UpdateTable(); } private void UpdateTable() { ListRecords?.Clear(); totalCount = 0; if (AllRecords != null) { ListRecords = AllRecords .Skip(numRecord * (currPage - 1)) .Take(numRecord) .ToList(); totalCount = AllRecords.Count; } } protected void SetNumPage(int newNum) { currPage = newNum; UpdateTable(); } protected void SetNumRec(int newNum) { currPage = 1; numRecord = newNum; UpdateTable(); } private async Task DoClose() { await EC_Close.InvokeAsync(true); } private async Task DoAdd(AnagOperatoriModel currRec) { // sollevo evento richiesta aggiunta ... await EC_ReqAdd.InvokeAsync(currRec); } }