Пример #1
0
 public DataTable()
 {
     Id       = "w8less-tbl-" + (++_IdCounter);
     Config   = new DataTableConfig <TEntity>();
     Columns  = new List <ColumnRenderInfo <TEntity> >();
     ReadData = default;
     Page     = 1;
     Process  = new DataTableProcess <TEntity>();
 }
        internal DataTableSource(DataTableProcess <TEntity> process, ReadData <TEntity> read, IReadOnlyList <ColumnRenderInfo <TEntity> > cols)
        {
            _process = process;
            _read    = read;
            Cols     = cols;
            Sorter   = new QuerySort <TEntity>();
            foreach (var col in cols)
            {
                col.AddToSorter(Sorter);
            }

            _process.ReadDataAsync = new ReadDataAsync(
                async(int page, int pageSize) =>
            {
                Result = await _read(new ReadDataRequest <TEntity>(this, page, pageSize));
            });
        }