Data Table

  • A FUIDataTable is a view that displaying data in either a list view or a grid table view.

    Code usage:

    let model = FUIDataTableModel(headerData: nil,
                                  rowData: rowData,
                                  isHeaderSticky: true,
                                  isFirstColumnSticky: true,
                                  columnAttributes: columnAttributes,
                                  rowAlignment: .top,
                                  isPinchZoomEnable: false,
                                  showRowDivider: true,
                                  showColoumnDivider: true,
                                  headerCellPadding: UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16),
                                  dataCellPadding: UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16),
                                  minRowHeight: 48,
                                  minColumnWidth: 48,
                                  allowsPartialRowDisplay: true,
                                  backgroundColor: .white,
                                  showListView: false)
    model.didSelectRowAt = { _ in
        print(model.selectedIndexes)
    }
    let dataTable = FUIDataTable(model: model)
    

    Theming

    Supported TEXT class paths:

    fdlFUIDataTable_textItem {}: TEXT theme for all cells. It has lowest priority.
    fdlFUIDataTable_textItem_row2 {}: TEXT theme for one speciif column. # is the column index. It has third priority.
    fdlFUIDataTable_textItem_column1 {}: TEXT theme for one specific row. # is the row index; header is row 0 if it existis. It has second priority.
    fdlFUIDataTable_textItem_row2_column1{}: TEXT theme for one specific cell. Row index and column index are required. It has highest priority.
    

    Supported TEXT properties:

    font-color: Color;
    font-style: UIFontTextStyle;
    text-line-clamp: Integer;
    text-align: NSTextAlignment;
    

    Supported IMAGE class paths:

    fdlFUIDataTable_imageItem {}: IMAGE theme for all cells. It has lowest priority.
    fdlFUIDataTable_imageItem_column# {}: IMAGE theme for one speciif column. # is the column index. It has third priority.
    fdlFUIDataTable_imageItem_row# {}: IMAGE theme for one specific row. # is the row index; header is row 0 if it existis. It has second priority.
    fdlFUIDataTable_imageItem_row#_column# {}: IMAGE theme for one specific cell. Row index and column index are required. It has highest priority.
    

    Supported IMAGE properties:

    tint-color: Color;
    image-name: String;
    
    See more

    Declaration

    Swift

    open class FUIDataTable : UIView
  • FUIDataTableModel is the data structure being used in FUIDataTable view.

    Code Usage:

    let header = FUITableRowItem(leadingAccessories: [], trailingAccessory: nil, data: titles)
    let model = FUIDataTableModel(headerData: nil,
                                  rowData: rowData,
                                  isHeaderSticky: true,
                                  isFirstColumnSticky: true,
                                  columnAttributes: columnAttributes,
                                  rowAlignment: .top,
                                  isPinchZoomEnable: false,
                                  showRowDivider: true,
                                  showColoumnDivider: true,
                                  headerCellPadding: UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16),
                                  dataCellPadding: UIEdgeInsets(top: 16, left: 16, bottom: 16, right: 16),
                                  minRowHeight: 48,
                                  minColumnWidth: 48,
                                  allowsPartialRowDisplay: true,
                                  backgroundColor: .white,
                                  showListView: false)
    model.didSelectRowAt = { _ in
    print(model.selectedIndexes)
    }
    
    See more

    Declaration

    Swift

    public class FUIDataTableModel
  • Column attribute for FUIDataTableModel

    See more

    Declaration

    Swift

    public struct FUITableColumnAttribute
  • An image item for FUIDataTable

    See more

    Declaration

    Swift

    public struct FUITableImageItem : FUITableItem
  • An enum representing the different item styles that a FUIDataTable can have.

    See more

    Declaration

    Swift

    public enum FUIDataItemType
  • A protocol defines style of a FUITableItem.

    See more

    Declaration

    Swift

    public protocol FUITableItem
  • Data structure for each row in the FUIDataTable

    See more

    Declaration

    Swift

    public struct FUITableRowItem
  • Text item for FUIDataTable

    See more

    Declaration

    Swift

    public struct FUITableTextItem : FUITableItem