Class LayoutsController
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Controllers
Assembly: LemonEdge.ClientEntities.dll
Syntax
public class LayoutsController : BaseGridController<ILayout>, IBaseGridController, ICollectionExportable, INewGridItemImplementor<ILayout>, ICopyGridItemImplementor<ILayout>, IGrid, IDeleteGridItemImplementor<ILayout>, ISearchController, IModelViewController
Constructors
LayoutsController(IBaseGrid<ILayout>)
Declaration
public LayoutsController(IBaseGrid<ILayout> view)
Parameters
Type | Name | Description |
---|---|---|
IBaseGrid<ILayout> | view |
Properties
AutoOpenNewItemInTab
Indicates when creating a new item in the grid that it should automatically be opened in a new tab as well
The default is true if the type ILayout is an entity that is not a IsStandingDataEntity
Declaration
public override bool AutoOpenNewItemInTab { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
ContextHelpURL
An optional associated url of a help file for the view this controller works with
Declaration
public override string ContextHelpURL { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
DefaultSearchColumn
The name of the column to use in the default search of text in the grid
Declaration
protected override string DefaultSearchColumn { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
AlterColumnInfo(ControlDisplayInfo)
Provides an inheriting controller the opportunity to alter the specified column before it is added to the IBaseGrid<T>
This is used in conjunction with columns defined via ColumnNames(), rather than Columns() which explicitly defines all information
The default operation provides a CustomComboItems if the column is against a property that is a link to an entity type (IsEntityLink)Declaration
protected override void AlterColumnInfo(ControlDisplayInfo info)
Parameters
Type | Name | Description |
---|---|---|
ControlDisplayInfo | info | The definition of the column that can be updated before being created in the IBaseGrid<T> |
Overrides
AlterLoadedItems(IEnumerable<ILayout>)
Provides a mechanism for an inhetiring class to alter all the loaded items before they are sent to the GridView to be displayed
Declaration
protected override Task<IEnumerable<ILayout>> AlterLoadedItems(IEnumerable<ILayout> items)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ILayout> | items | The items loaded for display into the GridView |
Returns
Type | Description |
---|---|
Task<IEnumerable<ILayout>> |
Overrides
AlterQuery(QueryableExecuter<ILayout>)
Provides the inheriting controller an opportunity to modify the query used to load the data for this IBaseGrid<T>
Default implementation does nothing unless the type ILayout is an entity with a property with a SequenceStart, in which case it is ordered by that
Declaration
protected override QueryableExecuter<ILayout> AlterQuery(QueryableExecuter<ILayout> query)
Parameters
Type | Name | Description |
---|---|---|
QueryableExecuter<ILayout> | query | The query for this grid to always be altered before being executed |
Returns
Type | Description |
---|---|
QueryableExecuter<ILayout> | The query to be used to execute results for this grid |
Overrides
ColumnNames()
A list of all the columns to be dynamically created in the IBaseGrid<T>
This is used by the system to create the actual ControlDisplayInfo classes required from the Columns() property
You can override this to provide a simple definition of each column (combined with AlterControlInfo(ControlDisplayInfo) for more detail), or you can just override Columns() and ignore thisDeclaration
protected override IEnumerable<ControlDisplayInfoLight> ColumnNames()
Returns
Type | Description |
---|---|
IEnumerable<ControlDisplayInfoLight> | A list of all the columns to be dynamically created in the IBaseGrid<T> |
Overrides
DisplayUI()
Initializes the grid, and creates every ControlDisplayInfo in the defined Columns() and creates them on the grid
Then loads the data for the grid accounting for all view sorting, filtering, searching and paging, and loads the results into the grid as an observable collection
Declaration
public override Task DisplayUI()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |
Overrides
GetLayoutComboItems()
Declaration
public IEnumerable<KeyValuePair<string, string>> GetLayoutComboItems()
Returns
Type | Description |
---|---|
IEnumerable<KeyValuePair<string, string>> |
GetLayoutParamComboItems(Layout)
Declaration
public KeyValuePair<string, string>[] GetLayoutParamComboItems(Layout item)
Parameters
Type | Name | Description |
---|---|---|
Layout | item |
Returns
Type | Description |
---|---|
KeyValuePair<string, string>[] |
InitCommands(IList<ViewCommand>)
Adds the following commands, if the associated AllowXXXCommand property returns true: A public toggle, multi-select row, open, column visiblitiy, transfer visible, search, view cancelled, view system, export, new, copy, move up/down, xml export, and delete commands
Declaration
protected override void InitCommands(IList<ViewCommand> commands)
Parameters
Type | Name | Description |
---|---|---|
IList<ViewCommand> | commands | The initial set of commands for this view |
Overrides
OnTrackedItemChanged(object, string)
Provids a mechanism for handling changes for any item in the context
By default this is used to apply changes made to a selected item automatically to all other selected items in the grid (if multi-select is enabled)
Declaration
protected override void OnTrackedItemChanged(object item, string propName)
Parameters
Type | Name | Description |
---|---|---|
object | item | The item that changed |
string | propName | The property name of the changed value |
Overrides
UpdateNewItem(ILayout)
Provides an inheriting controller an opportunity to alter the newly created item by the grid before it is added to the IBaseGrid<T> itself
By default this ensures the item has the next maximum sequence number if the item is an entity that has a property with a SequenceStart
Declaration
protected override Task UpdateNewItem(ILayout item)
Parameters
Type | Name | Description |
---|---|---|
ILayout | item | The newly created item to be added to the grid |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |