webismymind / editablegrid

EditableGrid is an open source Javascript library aimed at turning HTML tables into advanced editable components. It focuses on simplicity: only a few lines of code are required to get your first table up and running.
http://www.editablegrid.net
Other
795 stars 272 forks source link

Add a new row #37

Closed jcketz closed 11 years ago

jcketz commented 11 years ago

Hi! First of all thanks a lot for this wonderful library.

I have succeeded importing it to a django server and make it work with python. auto saving each value modification to server.

But now I'd like to append an empty row except the first column which is the index row value. Do you have a scripted example for that?

I've tried the duplicate() and the insertAfter() value. but it doesn't changes the current row values but the previous one. and also import the this.getrowvalues(this.getRowcount-1). Do you have an easy way to do that? Thanks a lot

webMac commented 9 years ago

How about

editableGrid.append(editableGrid.data.length, { 'yourDefaultKey1': 'yourDefaultValue1' }, true);

?