implement add different type of new rows in JS