Table of Contents

ColumnsPanel widget

This widget represents “columns panel” - a rectangular area of your web-page which contains the list of query result columns and provides some operations for manipulating with that list: add/remove a column, change its type, set column's sorting, etc.

Options

showAddRow

Type:Boolean
Default:true
Gets or sets a value indicating whether columns panel must show a special [add column] link at the bottom

showHeader

Type:Boolean
Default:true
Gets or sets a value indicating whether columns panel must show a header at the top

showColumnCaptions

Type:Boolean
Default:true
Gets or sets a value indicating whether columns panel must show an editable caption for each column (i.e. “SELECT ColumnName AS ColumnCaption…”)

allowAggrColumns

Type:Boolean
Default:true
Gets or sets a value indicating whether columns panel allows user to use aggregated columns

allowSorting

Type:Boolean
Default:true
Gets or sets a value indicating whether columns panel allows user to set columns sorting

attrElementFormat

Type:String
Default:'{entity} {attr}'
Gets or sets the format of the attribute display name. '{entity}' is replaced with entity name, '{attr}' is replaced with attribute name

alwaysShowButtons

Type:Boolean
Default:false
Gets or sets a value indicating whether the service buttons are permanently displayed in all columns (true), or just in active column and the column user moves the cursor over (false)

accentActiveColumn

Type:Boolean
Default:true
Gets or sets a value indicating whether the active column should be backlighted and permanently display the service buttons

Methods

setQuery

Sets the query object the columns panel should work with. The panel content will be re-rendered
query
Type:PlainObject
The query object.


clearColumns

Clears the list of columns in associated query and redraws a panel, if needed
needRefresh
Type:Boolean
Indicates whether the panel should be redrawn after the changes in the query. Set it to “false” to performs some bulk operations.
Example:

var ColumnsPanelDiv = $("#ColumnsPanel");
ColumnsPanelDiv.ColumnsPanel('clearColumns', false);
ColumnsPanelDiv.ColumnsPanel('addNewColumn', 'some_attr_id');


addNewColumn

Returns:The added column object
Adds a new column to the query and updates the columns panel
attrid
Type:String (or Array of Strings)
The ID (or the array of IDs) of the attribute the new column is based on.
index
Type:Integer
The position in the columns list the new column(s) should be inserted to. If undefined, the column is added to the end of the list.


addColumn

Adds a new column to the query and updates the columns panel
column
Type:PlainObject (or Array of PlainObject)
The column object (or the array of such objects) to be added.
index
Type:Integer
The position in the columns list the new column(s) should be inserted to. If undefined, the column is added to the end of the list.


removeColumn

Remove the column object from the list of columns and updates the columns panel
column
Type:PlainObject (or Array of PlainObject)
The column object to be removed.


removeColumnByAttrId

Remove the column object from the list of columns and updates the columns panel
attrId
Type:String
The ID of the attribute. The first found column with such an attribute ID will be removed.


refresh

Re-renders the panel


setActiveColumn

Activates the particular column in the panel
column
Type:Object
The ColumnRow_ENTATTR or ColumnRow_AGGRFUNC object to activate.