Aller au contenu principal
Version: 20 R6 BETA

VP INSERT TABLE ROWS

Historique
ReleaseModifications
19 R7Ajout

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

ParamètresTypeDescription
vpAreaNameText->Nom d'objet formulaire zone 4D View Pro
tableNameText->Nom de table
rowInteger->Index in the table of the starting row to insert
countText->Number of rows to add (must be >0)
insertAfterInteger->vk table insert before or vk table insert after row
sheetInteger->Numéro d'indice de la feuille (feuille courante si omis)

Description

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:

ConstanteValeurDescription
vk table insert before0Insert row(s) before the row (default if omitted)
vk table insert after1Insert row(s) after the row

This command inserts some rows in the tableName table, NOT in the sheet. The total number of rows of the sheet is not impacted by the command. Data present below the table (if any) are automatically moved down according to the number of added rows.

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

Si tableName n'existe pas ou s'il n'y a pas assez d'espace dans la feuille, rien ne se passe.

Exemple

Vous créez une table avec un contexte de données :

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")

You want to insert two rows and two columns in the table, you can write:

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

Voir également

VP INSERT TABLE COLUMNS
VP REMOVE TABLE ROWS