removeColumn (NotesView - JavaScript™)
Removes a column.
Defined in
NotesViewSyntax
removeColumn() : void
removeColumn(columntitle:string) : void
removeColumn(columnindex:int) : void
Parameter | Description |
---|---|
columntitle |
The title of the column. Defaults to the last column. |
columnindex |
The position of the column. Defaults to the last column. |
Usage
Positioning is 1-based. This differs from the vector returned by Columns, which is 0-based.Examples
This button creates a new view, deletes its columns, copies a column from another view, and creates two columns.var v:NotesView = database.getView("main");
// Create "dates" view and remove all columns
var main:NotesView = database.getView("main");
var dates:NotesView = database.createView("dates", "SELECT @All");
while (dates.getColumnCount() > 0) {
dates.removeColumn(dates.getColumnCount());
}
requestScope.status = "New view " + dates.getName();
// Copy column 1 from "main" to "dates"
var col1:NotesViewColumn = dates.copyColumn(main.getColumn(1), 1);
requestScope.status += "\n" +
col1.getPosition() + " " + col1.getTitle() + " " + col1.getFormula();
var col2:NotesViewColumn = dates.createColumn(
dates.getColumnCount() + 1, "Created on", "@Created");
requestScope.status += "\n" +
col2.getPosition() + " " + col2.getTitle() + " " + col2.getFormula();
var col3:NotesViewColumn = dates.createColumn(
dates.getColumnCount() + 1, "Last modified on", "@Modified");
requestScope.status += "\n" +
col3.getPosition() + " " + col3.getTitle() + " " + col3.getFormula();