This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AyaNova.Models;
|
||||
using AyaNova.Biz;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -33,10 +34,13 @@ namespace AyaNova.DataList
|
||||
public Dictionary<string, string> DefaultSortBy { get; set; }
|
||||
|
||||
//set defaults if not provided in listOptions
|
||||
public void SetListOptionDefaultsIfNecessary(DataListOptions listOptions)
|
||||
public void SetListOptionDefaultsIfNecessary(DataListBase listOptions)
|
||||
{
|
||||
if (listOptions.Columns.Count == 0)
|
||||
listOptions.Columns = DefaultColumns;
|
||||
if(listOptions is DataListTableOptions){//if this doesn't work then just ditch this method in favor of local code, it's not really saving much
|
||||
if (((DataListTableOptions)listOptions).Columns.Count == 0)
|
||||
((DataListTableOptions)listOptions).Columns = DefaultColumns;
|
||||
}
|
||||
|
||||
if (listOptions.SortBy.Count == 0)
|
||||
listOptions.SortBy = DefaultSortBy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user