VP INSERT TABLE ROWS
Historique
Release | Modifications |
---|---|
19 R7 | Ajout |
VP INSERT TABLE ROWS ( vpAreaName : Text ; tableName : Text ; row : Integer {; count : Integer {; insertAfter : Integer {; sheet : Integer }}} )
Paramètres | Type | Description | ||
---|---|---|---|---|
vpAreaName | Text | -> | Nom d'objet formulaire zone 4D View Pro | |
tableName | Text | -> | Nom de table | |
row | Integer | -> | Index in the table of the starting row to insert | |
count | Text | -> | Number of rows to add (must be >0) | |
insertAfter | Integer | -> | vk table insert before or vk table insert after row | |
sheet | Integer | -> | 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:
Constante | Valeur | Description |
---|---|---|
vk table insert before | 0 | Insert row(s) before the row (default if omitted) |
vk table insert after | 1 | Insert 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)