cancel
Showing results for 
Search instead for 
Did you mean: 

create new blank row in table at the topmost line always

Former Member
0 Kudos

Hi all

my problem is : when i click on a button to add new row in a table , it always appear below other rows and not at the top most line.

i know if add "0" to this method "addElement(var)" , it can solve my problem.

but if i add "0" in this method, it goes against my project requirement.

So anybody can help me out of this issue.

thanks in advance

kaushik

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kaushik

Could you explain why adding an element at index 0 in a node ( and this solves you purpose), "goes against your project requirements" ?.

Is it that although you want the row to be added at the the top for user input, but after input it should logically be at the bottom. If that is the case what you can do is instead of making table rows editable, you can have input fields outside the table (on the top of the table as you want!) , and on the action of some add button, append the values input at the bottom.

Alternatively if you do not have two many input fields( just one or two), you can have the input fields in the table toolbar itself ( will always be on the top!), and on some action add the element to the table node..

Regards

kk

Former Member
0 Kudos

hi to kk from kk

well kk i used the word "against my req." to restrict other users asking why i am not in mood to add "0" to add element , ok let me come to problem now :

On click of a button , i am adding a new row to my table.

the issue is when i use addElement(0, objResult), i am able to get my new blank row as the first row always and suppose i added number of rows ,but when i save the data it adds only one row to database.

and if just use addElement(objResult) then any number of rows gets added to database easily but the new blank row comes below the filled rows.

i am also thinking in a way that if anyhow i can set the index of my new blank row to "0"

and that may solve my problem. (what do u think abt this )

thanks

kaushik

Former Member
0 Kudos

Hello Kaushik

I think you should inspect the logic that is being used to save the rows to database. If you come to know that, then you can find out how to save multiple rows by using "addElement(0,..) method. Just give a try, it might help you.

Regards

KK