FUIDataTableModel

public class FUIDataTableModel

FUIDataTableModel is the data structure being used in FUIDataTable view.

Code Usage:

let header = FUITableRowItem(leadingAccessories: [], trailingAccessory: nil, data: titles)
let model = FUIDataTableModel(headerData: header, rowData: res, isFirstRowSticky: true, isFirstColumnSticky: true, showListView: true)
model.columnAttributes = ...
model.didSelectRowAt = { _ in
print(model.selectedIndexes)
}
  • FUITableRowItem, header data for displaying.

    Declaration

    Swift

    public var headerData: FUITableRowItem? { get set }
  • Data for each row.

    Declaration

    Swift

    public var rowData: [FUITableRowItem] { get set }
  • Set header to be sticky.

    Declaration

    Swift

    public var isHeaderSticky: Bool { get set }
  • Set first column to be sticky.

    Declaration

    Swift

    public var isFirstColumnSticky: Bool { get set }
  • Set horizontal scrolling.

    Declaration

    Swift

    public var horizontalScrolling: Bool { get set }
  • Show list view in iPhone protrait mode.

    Declaration

    Swift

    public var showListView: Bool { get set }
  • Enable or disable pinch and zoom.

    Declaration

    Swift

    public var isPinchZoomEnable: Bool { get set }
  • Column attribute for each column.

    Declaration

    Swift

    public var columnAttributes: [FUITableColumnAttribute] { get set }
  • Selection did change handler.

    Declaration

    Swift

    public var didSelectRowAt: ((_ index: Int) -> Void)? { get set }
  • Selected Indexes.

    Declaration

    Swift

    public var selectedIndexes: [Int] { get set }
  • Public initializer for FUIDataTableModel.

    Declaration

    Swift

    public init(headerData: FUITableRowItem? = nil,
                rowData: [FUITableRowItem] = [],
                isHeaderSticky: Bool = false,
                isFirstColumnSticky: Bool = false,
                columnAttributes: [FUITableColumnAttribute] = [],
                isPinchZoomEnable: Bool = false,
                showListView: Bool = false)

    Parameters

    headerData

    Header data for displaying.

    rowData

    Data for each row.

    isHeaderSticky

    Set header to be sticky.

    isFirstColumnSticky

    Set first column to be sticky.

    columnAttributes

    Column attribute for each column.

    isPinchZoomEnable

    Set if pinch and zoom enble, the default is false.

    showListView

    Show list view in iPhone protrait mode.