ludo.grid.ColumnManager

ludo.grid.


new ludo.grid.ColumnManager(config)

Column manager for grids. Grids will listen to events fired by this component. A column manager is usually created by
sending a "columns" array to the constructor of a grid.Grid view.

Parameters:
Name Type Description
config Object
Source:
Fires:
  • ludo.grid.ColumnManager#showcolumn Fired when a column is shown.event: Argument: {String} column name
  • ludo.grid.ColumnManager#hideColumn Fired when a column is hidden.event: Argument: {String} column name
  • ludo.grid.ColumnManager#moveColumn Fired when a column has been moved. Argument: 1) {String} column moved,event: 2) {String} new sibling column 3) {String} before or after new sibling
Example
columnManager:{
		columns:{
			'country':{
				heading:'Country',
				removable:false,
				sortable:true,
				movable:true,
				width:200,
				renderer:function (val) {
					return '<span style="color:blue">' + val + '</span>';
				}
			},
			'capital':{
				heading:'Capital',
				sortable:true,
				removable:true,
				movable:true,
				width:150
			},
			population:{
				heading:'Population',
				movable:true,
				removable:true
			}
		}
	}
 Is example of a ColumnManager config object sent to a grid. It defines three columns, "country", "capital" and "population". These names
 corresponds to keys in the data sets. How to configure columns is specified in {{#crossLink "grid.Column"}}{{/crossLink}}

Extends

  • Core

Methods


getColumnsInRow(rowNumber) → {Array}

Return array of column keys for a header row, 0 is first row

Parameters:
Name Type Description
rowNumber Number
Source:
Returns:

columns

Type
Array

getGroupFor(column) → {grid.Column|undefined}

Returns parent group object for a column

Parameters:
Name Type Description
column String
Source:
Returns:

parent

Type
grid.Column | undefined

getGroupIdOf(column) → {String}

Returns id of parent group

Parameters:
Name Type Description
column String
Source:
Returns:

group id

Type
String

getVisibleColumns() → {Object}

Returns object of visible columns, example:

Source:
Returns:

visible columns

Type
Object
Example
{
            country : {
                heading : 'Country'
            },
            population: {
                heading : 'Population'
            }
        }

insertColumnAfter(column, after)

Insert a column after given column

Parameters:
Name Type Description
column String

id

after String

column id

Source:

insertColumnBefore(column, before)

Insert a column before given column

Parameters:
Name Type Description
column String

id

before String

column id

Source:

isInAGroup(column) → {Boolean}

Returns true if column with given id is in a group.

Parameters:
Name Type Description
column String
Source:
Returns:

is in a group

Type
Boolean

isResizable(column) → {Boolean}

Returns true if column with given id is resizable

Parameters:
Name Type Description
column String
Source:
Returns:
Type
Boolean

removeFromGroup(column) → {Boolean}

Remove column from a group

Parameters:
Name Type Description
column String
Source:
Returns:

success

Type
Boolean