user3815273
user3815273

Reputation:

how to add a new row in top of a json datatable with already existing records

I am trying to add a row in top of a datatable which shows sum of a column "amount".I am using json datatable(jquery plugin) list to display datatable. How can i add this row in top of datatable with existing rows?

Upvotes: 3

Views: 1321

Answers (1)

Haris N I
Haris N I

Reputation: 6854

I think this code will help you

var json = '{ "uid": "user123", "firstName": "User", "lastName": "Theuser" }';
userTable.fnAddData(json);

Please refer the below link

JsonDatatable

Or

At the time of fetching data from table take sum also and make it as first row

Upvotes: 2

Related Questions