Raja
Raja

Reputation: 219

Insert tr in table at 0th position

I have the jQuery object of table rows and I have use the following code snippet to insert the table row:

 $(proxy._gridRows).eq(args.recordIndex).after(addedGridRow);

Here proxy._gridRows =Table Rows
     args.recordIndex=0;
     addedGridRow =html string for tr;

In this case row inserted into the first index. How to insert the table row in the 0th index?

Upvotes: 0

Views: 164

Answers (1)

schnill
schnill

Reputation: 955

use prepend on the table as

table.prepend(row)

table is jquery table element

row is jquery tr element which you want to insert at 0th position in table

Upvotes: 1

Related Questions