Inline columns The LINAK ® inline column programme is designed for desks without crossbar. It ensures more leg space and more design possibilities. Our columns are known for their high quality, stability, and high degree of customisation. The Kendo UI grid widget supports static/frozen columns by a single configuration setting. Simply set the locked attribute of the corresponding column to true, and this will bring the column in the locked columns group positioned on the left in the grid. Here locked columns are OrderID and ShipName, while the rest of the columns can be scrolled.
Note: Different loc and iloc is iloc exclude last column range element. Method #5: Drop Columns from a Dataframe by iterative way. Remove all columns between a specific column name to another columns name. The text displayed on the column. EFilter: The container with the icon that will appear if the user filters this column. ESortOrder: In case of sorting my multiple columns, this shows the index that represents the position of this column in the order. ESortAsc: In case of sorting ascending the data in the column, this shows the associated icon. It can be difficult to read a multi-column email on a small screen; having to scroll horizontally is kind of a pain. Reading on small displays tends to work better if it’s done in a linear fashion, from top-to-bottom. Using media queries we can switch a multi-column layout to a single-column one, making it easier to read an email.
By Bill Graziano on 6 August 2007 | Tags: Identity , INSERT
Identity columns are commonly used as primary keys in database tables. These columns automatically assign a value for each new row inserted. But what if you want to insert your own value into the column? It's actually very easy to do.
First we'll need a table to work with. My examples will use this table:
Simply trying to INSERT a value into the identity column generates an error:
The trick is to enable IDENTITY_INSERT for the table. That looks like this:
Here are some key points about IDENTITY_INSERT
- It can only be enabled on one table at a time. If you try to enable it on a second table while it is still enabled on a first table SQL Server will generate an error.
- When it is enabled on a table you must specify a value for the identity column.
- The user issuing the statement must own the object, be a system administrator (sysadmin role), be the database owner (dbo) or be a member of the db_ddladmin role in order to run the command.
If you insert a value greater than the current identity seed SQL Server uses the value to reset the identity seed. For example:
We have another article on understanding identity columns that covers resetting an identity seed and determining what value was inserted. You can also see a list of all our articles that cover identity columns.
Related ArticlesFast CSV Import in PowerShell to SQL Server (18 March 2014) Efficiently Reuse Gaps in an Identity Column (9 February 2010) Custom Auto-Generated Sequences with SQL Server (24 April 2007) Using Views to Enforce Business Rules (9 April 2007) Using the OUTPUT Clause to Capture Identity Values on Multi-Row Inserts (14 August 2006) Anticipating Primary Key Violations (23 November 2003) Using EXISTS (12 October 2003) Understanding Identity Columns (9 March 2002) | Other Recent Forum PostsPython Security (3h) Merge two select quiries (6h) Download a file from SQL Server (17h) Heat map data pivot? (2d) Duplicates two columns and two rows (2d) Does [Col1] <> 'VALUE' return NULLs or not? (2d) Transact sql error need help (2d) SQL 2008 R2 Remote Blob Store v. 10.50 (3d) |
Subscribe to SQLTeam.com
Resources
Definition of columns props on BootstrapTable
Required
Optional
column.dataField (required) - [String]
Use dataField
to specify what field should be apply on this column. If your raw data is nested, for example:
You can use dataField
with dot(.
) to describe nested object:
column.text (required) - [String]
text
will be the column text in header column by default, if your header is not only text or you want to customize the header column, please check column.headerFormatter
column.type - [String]
Specify the data type on column. Available value so far is string
, number
, bool
and date
. Default is string
.column.type
can be used when you enable the cell editing and want to save your cell data with correct data type.
column.isDummyField - [Bool]
Sometime, you just want to have a column which is not perform any data but just some action components. In this situation, we suggest you to use isDummyField
. If column is dummy, the column.dataField
can be any string value, cause of it's meaningless. However, please keep dataField
as unique as possible.
There's only one different for dummy column than normal column, which is dummy column will compare the whole row value instead of cell value when call shouldComponentUpdate
.
column.hidden - [Bool]
hidden
allow you to hide column when true
given.
column.formatter - [Function]
formatter
allow you to customize the table column and only accept a callback function which take four arguments and a JSX/String are expected for return.
cell
row
rowIndex
Attention:Don't use any state data or any external data in formatter function, please pass them via formatExtraData
.In addition, please make formatter function as pure function as possible as you can.
column.headerFormatter - [Function]
headerFormatter
allow you to customize the header column and only accept a callback function which take three arguments and a JSX/String are expected for return.
column
: current column object itselfcolIndex
: index of current columncomponents
: an object which contain all of other react element, like sort caret or filter etc.
The third argument: components
have following specified properties:
column.formatExtraData - [Any]
It's only used for column.formatter
, you can define any value for it and will be passed as fourth argument for column.formatter
callback function.
column.sort - [Bool]
Enable the column sort via a true
value given.
column.sortValue - [Function]
column.sortValue
only work when column.sort
enabled. This prop allow you to replace the value when table sorting.
For example, consider following data:
In above case, when user try to sort Job Type column which will sort the original value: 0, 1, 2 but we display the type name via column.formatter
, which will lead confuse because we are sorting by type value instead of type name. So sortValue
is a way for you to decide what kind of value should be adopted when sorting on a specify column:
column.sortFunc - [Function]
column.sortFunc
only work when column.sort
is enable. sortFunc
allow you to define your sorting algorithm. This callback function accept six arguments:
The possible value of order
argument is asc
and desc
.
column.sortCaret - [Function]
Usecolumn.sortCaret
to custom the sort caret. This callback function accept two arguments: order
and column
The possible value of order
argument is asc
, desc
and undefined
.
column.onSort - [Function]
column.onSort
is an event listener for subscribing the event of sort:
column.classes - [String | Function]
It's available to have custom class on table column:
In addition, classes
also accept a callback function which have more power to custom the css class on each columns. This callback function take 4 arguments and a String
is expected to return:
Parameters
cell
: The value of current cell.row
: The value ofrow
being processed in theBootstrapTable
.rowIndex
: The index of the currentrow
being processed in theBootstrapTable
.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Return value
A new String
will be the result as element class.
column.headerClasses - [String | Function]
It's similar to column.classes
, headerClasses
is available to have customized class on table header column:
Furthermore, it also accept a callback function which takes 2 arguments and a String
is expect to return:
Parameters
column
: The value of current column.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Return value
A new String
will be the result of element headerClasses.
column.style - [Object | Function]
It's available to have custom style on table column:
In addition, similar to column.classes
, style
also accept a callback function which have more power to customize the inline style
on each columns. This callback function takes 4 arguments and an Object
is expect to return:
Parameters
cell
: The value of current cell.row
: The value ofrow
being processed in theBootstrapTable
.rowIndex
: The index of the currentrow
being processed in theBootstrapTable
.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Return value
A new Object
will be the result of element style.
column.headerStyle - [Object | Function]
It's available to have customized inline-style on table header column:
Moreover, it also accept a callback function which takes 2 arguments and an Object
is expect to return:
Parameters
column
: The value of current column.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Return value
A new Object
will be the result of element headerStyle.
column.title - [Bool | Function]
react-bootstrap-table2
is disable HTML title
as default. You can assign title
as true
to enable the HTML title on table column and take cell content
as default value. Additionally, you could customize title via a callback. It takes 4 arguments and a String
is expect to return:
Parameters
cell
: The value of current cell.row
: The value ofrow
being processed in theBootstrapTable
.rowIndex
: The index of the currentrow
being processed in theBootstrapTable
.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Return value
A new String
will be the result of element title.
column.headerTitle - [Bool | Function]
headerTitle
is only for the title on header column, default is disable. The usage almost same as column.title
,
It's also available to custom via a callback function:
Parameters
column
: The value of current column.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Return value
A new String
will be the result of element headerTitle.
column.align - [String | Function]
You can configure the CSS text-align for table column by align
property.
Besides, align
also accept a callback function for dynamically setting text align. It takes 4 arguments and a String
is expect to return:
Parameters
cell
: The value of current cell.row
: The value ofrow
being processed in theBootstrapTable
.rowIndex
: The index of the currentrow
being processed in theBootstrapTable
.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Return value
A new String
will be the result of element text alignment.
column.headerAlign - [String | Function]
It's almost same as column.align
, but it's for the CSS text-align on header column.
Also, you can custom the align by a callback function:
Parameters
column
: The value of current column.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Return value
A new String
will be the result of element headerAlign.
Column Lockforce Columns Inline Line
column.events - [Object]
You can assign any HTML Event on table column via events
property.
react-bootstrap-table2
currently only support following events which will receive some specific information:
- onClick
- onDoubleClick
- onMouseEnter
- onMouseLeave
- onContextMenu
If the events is not listed above, the callback function will only receive the event
object.
column.headerEvents - [Object]
headerEvents
same as column.events
but this is for header column.
column.attrs - [Object | Function]
Via attrs
property, You can customize table column HTML attribute which allow user to configure the elements or adjust their behavior.
Not only Object
, callback function
is also acceptable. It takes 4 arguments and an Object
is expect to return:
Parameters
cell
: The value of current cell.row
: The value ofrow
being processed in theBootstrapTable
.rowIndex
: The index of the currentrow
being processed in theBootstrapTable
.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Return value
A new Object
will be the result of element HTML attributes.
Caution:
If column.classes
, column.style
, column.title
, column.hidden
or column.align
was given at the same time, property attrs
has lower priority and it will be overwritten:
column.headerAttrs - [Object | Function]
headerAttrs
is similar to column.attrs
but it works for header column.
Additionally, customize the header attributes by a 2 arguments callback function:
Parameters
column
: The value of current column.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Return value
A new Object
will be the result of element headerAttrs.
Caution:
Same as column.attrs, it has lower priority and will beoverwrited when other props related to HTML attributes were given.
headerSortingClasses - [String | Function]
headerSortingClasses
allows to customize class
for header cell when this column is sorting.
Furthermore, it also accepts a callback which takes 4 arguments and String
is expected to return:
column
: The value of current column.sortOrder
: The order of current sortingisLastSorting
: Is the last one of sorted columns.colIndex
: The index of the current column being processed in BootstrapTable.
headerSortingStyle - [Object | Function]
It's similiar to headerSortingClasses. It allows to customize the style of header cell when this column is sorting. A style Object
and callback
are acceptable. callback
takes 4 arguments and an Object
is expected to return:
column.footer - [String | Function]
Give a string to render the string value on the footer column.
This prop also accept a function:
column.footerFormatter - [Function]
footerFormatter
allow you to customize the table footer column and only accept a callback function which take two arguments and a JSX/String are expected for return.
column
columnIndex
column.footerClasses - [String | Function]
It's similar to column.classes
, footerClasses
is available to have customized class on table footer column:
Furthermore, it also accept a callback function which takes 2 arguments and a String
is expect to return:
Parameters
column
: The value of current column.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
column.footerStyle - [Object | Function]
Customized the inline-style on table footer column:
Moreover, it also accept a callback function which takes 2 arguments and an Object
is expect to return:
Parameters
column
: The value of current column.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
column.footerTitle - [Bool | Function]
Configure the title on footer column, default is disable. The usage is almost same as column.title
,
It's also available to custom via a callback function:
Parameters
column
: The value of current column.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
column.footerEvents - [Object]
footerEvents
same as column.events
but it is for footer column:
column.footerAlign - [String | Function]
It's almost same as column.align
, but it's for the CSS text-align on footer column.
Also, you can custom the align by a callback function:
Parameters
column
: The value of current column.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
column.footerAttrs - [Object | Function]
footerAttrs
is similar to column.attrs
but it works for footer column.
Additionally, customize the header attributes by a 2 arguments callback function:
Parameters
column
: The value of current column.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
column.editable - [Bool | Function]
column.editable
default is true, means every column is editable if you configure cellEdit
. But you can disable some columns editable via setting false
.
If a callback function given, you can control the editable level as cell level:
column.validator - [Function]
column.validator
used for validate the data when cell on updating. it's should accept a callback function with following argument:newValue
, row
and column
:
The return value can be a bool or an object. If your validation is pass, return true
explicitly. If your validation is invalid, return following object instead:
If you want to perform a asycn validation, you can do it like this:
column.editCellStyle - [Object | Function]
You can use column.editCellStyle
to custom the style of <td>
when cell editing. It like most of customizable functionality, it also accept a callback function with following params:
Parameters
cell
: The value of current cell.row
: The object ofrow
being processed in theBootstrapTable
.rowIndex
: The index of the currentrow
being processed in theBootstrapTable
.colIndex
: The index of the currentcolumn
being processed inBootstrapTable
.
Or take a callback function
column.editCellClasses - [String | Function]
You can use column.editCellClasses
to add custom class on <td>
when cell editing. It's same as column.editCellStyle
which also accept a callback function to able to custom your class more flexible. Following is the arguments of this callback function: cell
, row
, rowIndex
, colIndex
.
Or take a callback function
column.editorStyle - [Object | Function]
This is almost same as column.editCellStyle
, but column.editorStyle
is for custom the style on editor instead of cell(td
).
column.editorClasses - [String | Function]
This is almost same as column.editCellClasses
, but column.editorClasses
is for custom the class on editor instead of cell(td
).
column.editor - [Object]
column.editor
allow you to custom the type of cell editor by following predefined type:
- Text(Default)
- Dropdown
- Date
- Textarea
- Checkbox
Following is a quite example:
Please check here for more detail about rich editors.
column.editorRenderer - [Function]
If you feel above predefined editors are not satisfied to your requirement, you can totally custom the editor via column.editorRenderer
:
Column Lockforce Columns Inline Excel
Please check here for more detail.
column.filter - [Object]
Configure column.filter
will able to setup a column level filter on the header column. Currently, react-bootstrap-table2
support following filters:
- Text Filter
- Select Filter
- Number Filter
- Date Filter
Column Lockforce Columns Inline Skates
We have a quick example to show you how to use column.filter
:
For some reason of simple customization, react-bootstrap-table2
allow you to pass some props to filter factory function. Please check here for more detail tutorial.
column.filterValue - [Function]
Sometimes, if the cell/column value that you don't want to filter on them, you can define filterValue
to return a actual value you wanna be filtered:
Parameters
cell
: The value of current cell.row
: The value of current row.
Return value
A final String
value you want to be filtered.
column.searchable - [Bool]
Default the column is searchable. Give false
to disable search functionality on specified column.
column.csvType - [Object]
Default is String
. Currently, the available value is String
and Number
. If Number
assigned, the cell value will not wrapped with double quote.
column.csvFormatter - [Function]
This is same as column.formatter
. But csvFormatter
only for CSV export and called when export CSV.
column.csvText - [String]
Custom the CSV header cell, Default is column.text
.
column.csvExport - [Bool]
Column Lockforce Columns Inline Function
Default is true
, false
will hide this column when export CSV.