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.
All options of ColumnsPanel widgets can be set through columnsPanel
property of easyQuerySettings
global variable.
Of course you can also set options and call methods of ColumnsPanel in an usual for jQuery widgets way.
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
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
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
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
Type:Number
Default:30
If the number of items in drop down menu exceeds this number then a search box will be displayed. Set this option to 0 if want to show the search box in any case
allowDragDrop
Type:Boolean
Default:true
Gets or sets a value indicating whether the columns may be dragged and dropped
Methods
clearColumns
Clears the list of columns in associated query and redraws a panel, if needed.
Note:
This method is deprecated. Use Query.clearColumns() instead.
addNewColumn
Returns:
(PlainObject)
The added column object
Adds a new column to the query and updates the columns panel
Parameters:
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
Parameters:
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
Parameters:
column
Type:PlainObject
The column object to be removed.
removeColumnByAttrId
Remove the column object from the list of columns and updates the columns panel
Parameters:
attrId
Type:String
The ID of the attribute. The first found column with such an attribute ID will be removed.
moveColumn
Moves the column object from its current position to specified direction
Parameters:
column
Type:PlainObject
The column object to be moved.
direction
Type:String
One of the following: 'MoveTop', 'MoveUp', 'MoveDown', 'MoveBottom'
refresh
Activates the particular column in the panel
Parameters:
columnWidget
Type:Object
The ColumnRow_ENTATTR or ColumnRow_AGGRFUNC object to activate.
Discussion