Documentation ¶
Index ¶
- type DataBinder
- type DataManager
- func (d *DataManager) GetData(ctx context.Context, owner DataManagerI)
- func (d *DataManager) HasDataProvider() bool
- func (d *DataManager) RangeData(f func(int, interface{}) bool)
- func (d *DataManager) ResetData()
- func (d *DataManager) SetData(data interface{})
- func (d *DataManager) SetDataProvider(b DataBinder)
- type DataManagerI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataBinder ¶
type DataBinder interface {
BindData(ctx context.Context, s DataManagerI)
}
type DataManager ¶
type DataManager struct { Data interface{} // contains filtered or unexported fields }
DataManager is an object designed to be embedded in a control that will help manage the data binding process.
func (*DataManager) GetData ¶
func (d *DataManager) GetData(ctx context.Context, owner DataManagerI)
GetData tells the data binder to load data by calling SetData on the given object. The object should be the embedder of the DataManager
func (*DataManager) HasDataProvider ¶
func (d *DataManager) HasDataProvider() bool
func (*DataManager) RangeData ¶
func (d *DataManager) RangeData(f func(int, interface{}) bool)
RangeData will call the given function for each item in the data. The function should return true to continue, and false to end early.
func (*DataManager) ResetData ¶
func (d *DataManager) ResetData()
func (*DataManager) SetData ¶
func (d *DataManager) SetData(data interface{})
Call SetData to set the data of a control that uses a data binder. You MUST call it with a slice of some kind of data.
func (*DataManager) SetDataProvider ¶
func (d *DataManager) SetDataProvider(b DataBinder)
type DataManagerI ¶
type DataManagerI interface { page.ControlI SetDataProvider(b DataBinder) // SetData should be passed a slice of data items SetData(interface{}) GetData(ctx context.Context, owner DataManagerI) ResetData() }
A DataManagerI is the interface for the owner (the embedder) of the DataManager
Click to show internal directories.
Click to hide internal directories.