Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

DataTablesModel.cs

namespace Nop.Web.Framework.Models.DataTables;

/// 
/// Represents base DataTables model
/// 
public partial record DataTablesModel : BaseNopModel
{
    #region Const

    protected const string DEFAULT_PAGING_TYPE = "simple_numbers";

    #endregion

    #region Ctor

    /// 
    /// Ctor
    /// 
    public DataTablesModel()
    {
        //set default values
        Info = true;
        RefreshButton = true;
        ServerSide = true;
        Processing = true;
        Paging = true;
        PagingType = DEFAULT_PAGING_TYPE;

        Filters = new List();
        ColumnCollection = new List();
    }

    #endregion

    #region Properties

    /// 
    /// Gets or sets table name
    /// 
    public string Name { get; set; }

    /// 
    /// Gets or sets URL for data read (ajax)
    /// 
    public DataUrl UrlRead { get; set; }

    /// 
    /// Gets or sets URL for delete action (ajax)
    /// 
    public DataUrl UrlDelete { get; set; }

    /// 
    /// Gets or sets URL for update action (ajax)
    /// 
    public DataUrl UrlUpdate { get; set; }

    /// 
    /// Gets or sets search button Id
    /// 
    public string SearchButtonId { get; set; }

    /// 
    /// Gets or set filters controls
    /// 
    public IList Filters { get; set; }

    /// 
    /// Gets or sets data for table (ajax, json, array)
    /// 
    public object Data { get; set; }

    /// 
    /// Enable or disable the display of a 'processing' indicator when the table is being processed 
    /// 
    public bool Processing { get; set; }

    /// 
    /// Feature control DataTables' server-side processing mode
    /// 
    public bool ServerSide { get; set; }

    /// 
    /// Enable or disable table pagination.
    /// 
    public bool Paging { get; set; }

    /// 
    /// Enable or disable information ("1 to n of n entries")
    /// 
    public bool Info { get; set; }

    /// 
    /// If set, populate the row id based on the specified field
    /// 
    public string RowIdBasedOnField { get; set; }

    /// 
    /// Enable or disable refresh button
    /// 
    public bool RefreshButton { get; set; }

    /// 
    /// Pagination button display options.
    /// 
    public string PagingType { get; set; }

    /// 
    /// Number of rows to display on a single page when using pagination
    /// 
    public int Length { get; set; }

    /// 
    /// This parameter allows you to readily specify the entries in the length drop down select list that DataTables shows when pagination is enabled
    /// 
    public string LengthMenu { get; set; }

    /// 
    /// Indicates where particular features appears in the DOM
    /// 
    public string Dom { get; set; }

    /// 
    /// Feature control ordering (sorting) abilities in DataTables
    /// 
    public bool Ordering { get; set; }

    /// 
    /// Gets or sets custom render header function name(js)
    /// See also https://datatables.net/reference/option/headerCallback
    /// 
    public string HeaderCallback { get; set; }

    /// 
    /// Gets or sets custom render function name(js) that is called every time DataTables performs a draw
    /// See also https://datatables.net/reference/option/drawCallback
    /// 
    public string DrawCallback { get; set; }

    /// 
    /// Gets or sets a number of columns to generate in a footer. Set 0 to disable footer
    /// 
    public int FooterColumns { get; set; }

    /// 
    /// Gets or sets custom render footer function name(js)
    /// See also https://datatables.net/reference/option/footerCallback
    /// 
    public string FooterCallback { get; set; }

    /// 
    /// Gets or sets indicate of child table
    /// 
    public bool IsChildTable { get; set; }

    /// 
    /// Gets or sets child table
    /// 
    public DataTablesModel ChildTable { get; set; }

    /// 
    /// Gets or sets primary key column name for parent table
    /// 
    public string PrimaryKeyColumn { get; set; }

    /// 
    /// Gets or sets bind column name for delete action. If this field is not specified, the default will be the alias "id" for the delete action
    /// 
    public string BindColumnNameActionDelete { get; set; }

    /// 
    /// Gets or set column collection 
    /// 
    public IList ColumnCollection { get; set; }

    #endregion
}