This commit is contained in:
@@ -32,7 +32,8 @@ namespace AyaNova.DataList
|
||||
throw new System.UnauthorizedAccessException("User roles insufficient for this datalist");
|
||||
|
||||
|
||||
//turn the DataListTableRequest into a
|
||||
//turn the DataListTableRequest into a DataListTableProcesingOptions object here
|
||||
DataListTableProcessingOptions dataListTableOptions = new DataListTableProcessingOptions(dataListTableRequest, DataList, ct);
|
||||
|
||||
DataList.SetListOptionDefaultsIfNecessary(dataListTableOptions);
|
||||
|
||||
@@ -261,7 +262,7 @@ namespace AyaNova.DataList
|
||||
// if (string.IsNullOrWhiteSpace(listView))
|
||||
// listView = DataList.DefaultListView;
|
||||
|
||||
DataList.ProcessRequest(dataListSelectionOptions);
|
||||
DataList.SetListOptionDefaultsIfNecessary(dataListSelectionOptions);
|
||||
|
||||
// //parse the list view
|
||||
// var ListViewArray = JArray.Parse(listView);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace AyaNova.DataList
|
||||
public Dictionary<string, string> DefaultSortBy { get; set; }
|
||||
|
||||
//set defaults if not provided in listOptions
|
||||
public void ProcessRequest(Models.DataListProcessingBase listOptions)
|
||||
public void SetListOptionDefaultsIfNecessary(Models.DataListProcessingBase listOptions)
|
||||
{
|
||||
//columns, filter and sortby could all be null
|
||||
if (listOptions.Filter == null)
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace AyaNova.DataList
|
||||
List<string> DefaultColumns { get; set; }
|
||||
Dictionary<string, string> DefaultSortBy { get; set; }
|
||||
|
||||
void ProcessRequest(Models.DataListProcessingBase listOptions);
|
||||
void SetListOptionDefaultsIfNecessary(Models.DataListProcessingBase listOptions);
|
||||
|
||||
Newtonsoft.Json.Linq.JArray GenerateReturnListColumns(List<string> columns);
|
||||
// List<string> GetFieldListFromListView(JArray listViewArray);
|
||||
|
||||
@@ -1,15 +1,35 @@
|
||||
using System.Collections.Generic;
|
||||
using AyaNova.DataList;
|
||||
|
||||
|
||||
namespace AyaNova.Models
|
||||
{
|
||||
public sealed class DataListTableProcessingOptions : DataListProcessingBase
|
||||
internal sealed class DataListTableProcessingOptions : DataListProcessingBase
|
||||
{
|
||||
public List<string> Columns { get; set; }
|
||||
public const int MaxPageSize = 1000;
|
||||
public const int DefaultOffset = 0;
|
||||
public const int DefaultLimit = 25;
|
||||
public int? Offset { get; set; }
|
||||
public int? Limit { get; set; }
|
||||
internal List<string> Columns { get; set; }
|
||||
internal const int MaxPageSize = 1000;
|
||||
internal const int DefaultOffset = 0;
|
||||
internal const int DefaultLimit = 25;
|
||||
internal int? Offset { get; set; }
|
||||
internal int? Limit { get; set; }
|
||||
|
||||
internal DataListTableProcessingOptions(
|
||||
DataListTableRequest request,
|
||||
IDataListProcessing dataList,
|
||||
AyContext ct)
|
||||
{
|
||||
//set some values from request
|
||||
Limit=request.Limit;
|
||||
Offset=request.Offset;
|
||||
base.ClientCriteria=request.ClientCriteria;
|
||||
base.DataListKey=request.DataListKey;
|
||||
|
||||
//populate some values from saved filter and default columnview
|
||||
|
||||
//COLUMNS
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user