Hi all,

I have a master detail screen. Both has grid panels. I want to enter data into the grid directly without using a dialog window. (I do not want to use dialog windows basically because it is more unwanted additional objects to work with for both users and developers making it difficult for both.) I looked in demos, srdemo and tutorials for an example of data entry directly into grid, but I could not find any. I am looking for some sample script for the following:

  1. Inserting a row before the current row.
  2. Inserting a row after the current row.
  3. Appending a row at the end of the grid.
  4. Duplicating a row.
  5. Inserting only one blank row and stopping any additional blank row being inserted. Currently I can enter any number of blank rows without actually entering any data.

May be these are very simple things. What I am looking for is best practice for doing these things?

Regards.

George

asked 02 Feb '14, 22:36

grajan777's gravatar image

grajan777
1011226
accept rate: 10%


Hi George,

The code below answers 1 and 4.

declare
  v_row_t api_datasource.tt_row;
  v_row_id number;
begin
  --read the current row
  v_row_t:=api_datasource.getrow('datasource1');
  --create new row
  v_row_id:=api_datasource.createrow('datasource1',api_datasource.getcurrentrowid('datasource1'));  
  --copy a value from the row you read to the new row
  api_datasource.setcolumnvalue('datasoruce1.column1',v_row_t('column1'),v_row_id);
end;

Regarding 3: simply create a new row. The api_datasource.createrow API creates the new row at the end of the datasource by default.

Regarding 2: use the api_datasource.nextrow to set the current row indicator to the next row and run the code above.

Regarding 5: there is no datasource setting to enforce this. It’s something that can be coded using a combination of Datasource API’s though. http://theformspider.com/API/api_datasource.html

Kind Regards,
Yalim

link

answered 03 Feb '14, 15:24

Yalim's gravatar image

Yalim ♦♦
2.8k5
accept rate: 22%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×85
×9
×2

Asked: 02 Feb '14, 22:36

Seen: 1,001 times

Last updated: 03 Feb '14, 15:24


© Copyright Gerger 2017