Saltar para o conteúdo principal
Versão: Próximo

VP INSERT TABLE ROWS

História
ReleaseMudanças
18 R6Adicionado

VP INSERT TABLE ROWS ( vpAreaName : Text ; tableName : Text ; row : Integer {; count : Integer {; insertAfter : Integer {; sheet : Integer }}} )

ParâmetroTipoDescrição
vpAreaNameText->Nome de objeto formulário área 4D View Pro
tableNameText->Nome da tabela
rowInteger->Índice na tabela da linha inicial a inserir
countText->Número de linhas a serem adicionadas (deve ser >0)
insertAfterInteger->vk table insert before or vk table insert after row
sheetInteger->Índice da folha (folha atual se omitida)

Descrição

The VP INSERT TABLE ROWS command inserts one or count empty row(s) in the specified tableName at the specified row index.

In the insertAfter parameter, you can pass one of the following constants to indicate if the row(s) must be inserted before or after the row index:

ParâmetrosValorDescrição
vk table insert before0Insert row(s) before the row (default if omitted)
vk table insert after1Inserir linha(s) após a row

This command inserts some rows in the tableName table, NOT in the sheet. O número total de linhas da folha não é impactado pelo comando. Dados presentes abaixo da tabela (se houver) são movidos para baixo automaticamente de acordo com o número de linhas adicionadas.

If the tableName table is bound to a data context, the command inserts new, empty element(s) in the collection.

If tableName does not exist or if there is not enough space in the sheet, nothing happens.

Exemplo

Você cria uma tabela com um contexto de dados:

var $context : Object
$context:=New object()

$context.col:=New collection
$context.col.push(New object("name"; "Smith"; "salary"; 10000))
$context.col.push(New object("name"; "Wesson"; "salary"; 50000))
$context.col.push(New object("name"; "Gross"; "salary"; 10500)) VP SET DATA CONTEXT("ViewProArea"; $context) VP CREATE TABLE(VP Cells("ViewProArea"; 1; 1; 3; 3); "PeopleTable"; "col")

Se quiser inserir duas linhas e duas colunas na tabela, pode escrever:

VP INSERT TABLE ROWS("ViewProArea"; "PeopleTable"; 1; 2)
VP INSERT TABLE COLUMNS("ViewProArea"; "PeopleTable"; 1; 2)

Veja também

VP INSERT TABLE COLUMNS
VP REMOVE TABLE ROWS