Column.bind
Column.bind is almost the same as the "simple column HTML". Here you do not add the v-grid-col
element to defined to columns, but you bind a array with properties to make the grid. Lets have a look on how to do this.
First we will set up or class. Like with "simple column HTML" we need to defined the required variables:
v-collection
But unlike "simple HTML" we also need to defined 1 extra for the columns. See class below.
For the HTML we skip the v-grid-col
element and bind out columnSetup
we just created.
This will then produce this grid you see below. Like "simple column HTML", dragdrop/resize and observe are also enabled by default here.
All attributes we have:
colWidth
colType
colField (REQUIRED)
colSort
colHeaderName
colFilter
colFilterTop
colCss
colAddRowAttributes
colAddFilterAttributes
More details about fields inn the array:
colWidth:
default is 100
sets the width of the column
colType:
default is "text"
options are "selection", "checkbox" or "image"
colField: (REQUIRED)
field/property of the data from collection
colSort:
default is ""
field name you want to do sorting on
colHeaderName:
default is col-field where first letter is set to uppercase
colFilter:
see v-filter in chapter 04 for more details
colFilterTop:
default is false
use false/true to set filter above/under label in header
colCss:
css you want to add, usefull with on-row draw event for setting colors based on values
colAddRowAttributes:
here you can put whatever you want and it gets added to row column, useful for own custom attributes
colAddFilterAttributes:
here you can put whatever you want and it gets added header column, useful for own custom attributes
Sample array from demo:
Last updated