ui.datalayout

A layout widget for building complex data structures and working with their data.

Webix DataLayout possesses the features of both a layout and a data component. With this widget, you can build complex data structures by arranging several data widgets in one layout. You can also perform CRUD operations with the elements of DataLayout, and dynamically set/get their values. This widget is based on Layout and operates the DataStore API

Check DataLayout documentation for a more detailed description.

Constructor

var datalayout = webix.ui({
    view:"datalayout",
    rows:[],
    data:[
        { id:"a1", template:"A1", type:" header" },
        { id:"a2", template:"A2", type:" header" },
        { id:"a3", template:"A3", type:" header" },
        { id:"a4", template:"A4", type:" header" }
    ]
});

Where to start

Methods
add adds an item to the store
addView adds a new view to a layout-like widget
adjust adjusts the component to the size of the parent HTML container
attachEvent attaches the handler to an inner event of the component (allows behavior customizations)
bind binds components
blockEvent temporarily blocks triggering of ALL events of the calling object
callEvent calls an inner event
clearAll removes all items from the component
count returns the number of currently visible items
define redefines a single configuration property (or a hash of properties)
destructor destructs the calling object
detachEvent detaches a handler from an event (which was attached before by the attachEvent method)
disable disables the calling view (makes it dimmed and unclickable)
enable enables the calling view that was disabled by the 'disable' method
exists checks whether an item with the specified id exists
filter filters the component
find returns rows that match the criterion
getChildViews returns child views of the calling component
getFirstId returns the ID of the first item
getFormView returns master form for the input
getIdByIndex returns the id of the item with the specified index
getIndexById returns the index of the item with the specified id
getItem gets the object of the data item with the specified id
getLastId returns the id of the last item
getNextId returns the ID of an item which is positioned the specified step after the specified item
getNode returns the main HTML container for the calling object
getParentView returns the parent view of the component
getPrevId returns the ID of an item which is positioned the specified step before the specified item
getTopParentView returns top parent view
getValue retrieves the values of DataLayout elements
hasEvent checks whether the component has the specified event
hide hides the view
index returns the cell index in the layout collection
isEnabled checks whether the view is enabled
isVisible checks whether the view is visible
load loads data from an external data source.
loadNext sends a request to load the specified number of records to the end of the client-side dataset or to the specified position
mapEvent routes events from one object to another
parse loads data to the component from an inline data source
queryView returns inner element/elements of a widget that correspond(s) to the defined parameters
reconstruct rebuilds the layout
refresh repaints the whole view or a certain item
remove removes the specified item/items from datastore
removeView removes the specified view of a layout-like component
render renders the specified item or the whole layout
resize adjusts the view to a new size
resizeChildren resizes all children of the called component
setValue sets data values for the inner elements of a datalayout
show makes the component visible
showBatch makes visible those elements, the parameter 'batch' of which is set to the specified name
sort sorts datastore
sync allows syncing two copies of data (all or just a part of it) from one DataCollection to another
unbind breaks "bind" link
unblockEvent cancels events blocking that was enabled by the 'blockEvent' command
updateItem updates the data item with new properties
Events
onAfterAdd fires after adding item to datastore
onAfterDelete fires after item deleting
onAfterLoad fires after data loading is complete
onAfterSort fires after sorting dataset
onBeforeAdd fires before adding item to datastore
onBeforeDelete fires before item deleting
onBeforeLoad fires immediately before data loading has started
onBeforeSort fires before sorting dataset
onBindRequest fires when the component is ready to receive data from the master component
onDataRequest fires when data from the server is requested for linear data structures (List, DataTable, DataView etc.) to implement dynamic data loading
onDataUpdate fires when data item is in update process
onDestruct occurs when component destroyed
onLoadError fires when an error occurs during data loading ( invalid server side response )
Properties
animate defines or disables view change animation.
borderless used to hide the component borders
cols array of views objects arranged horizontally
container an HTML container (or its id) where the component should be initialized
css the name of a css class that will be applied to the view container
data JavaScript array containing data for the component
datathrottle sets the polling interval (the time period between the completion of a network request and the next request for data)
datatype the type of loaded data
disabled indicates whether an item is enabled
gravity sets the view gravity (1 by default)
height sets the height of the component
hidden defines whether the view will be hidden initially
id the component ID
isolate masks IDs of all inner elements
margin defines the space around elements (applies the specified value to all elements)
maxHeight sets the maximum height for the view
maxWidth sets the maximum width for the view
minHeight sets the minimal height for the view
minWidth sets the minimal width for the view
on allows attaching custom handlers to inner events of the component
padding defines the space between the element borders and content (applies the specified value to all sides).
paddingX sets the right and left padding (applies the specified value to both sides)
paddingY sets the top and bottom padding (applies the specified value to both sides)
ready the event handler is called just after the component has been completely initialized
removeMissed defines how to treat items in case of reloading
responsive enables responsive mode for horizontal layout
rows array of views objects arranged vertically
save defines URLs for data saving
scheme defines schemes for data processing
type defines the layout borders
url the URL which the component will use to load data after its initialization
visibleBatch sets the batch that will be shown initially
width sets the width of the component
Other
$getSize returns the current size of the component
$height the current height of the view
$setSize sets the component size
$skin the method which will be called when skin is defined
$view reference to the top HTML element of the view
$width the current width of the view
config all options from the initial component configuration
data inner DataStore
name indicates the name of the component (a read-only property)
waitData eventual result of an asynchronous operation ('promise' object) for the loaded data
Back to top