Create an empty row on html5 Excel

Create an empty row on html5 Excel

jacobruvalcabajacobruvalcaba Posts: 10Questions: 6Answers: 0
edited October 2016 in Free community support

I am using the button plugin which is great.
I am trying to add an empty row based on a condition, not sure how this would be done.

This is an example

 $('row c[r^="A"]', sheet).each( function () {

        if ( $('is t', this).text() != cell ) {

                // create empty row
                     
               
                // var cell = the new cell
                 cell = $('is t', this).text();

               }
         });

Answers

  • allanallan Posts: 64,385Questions: 1Answers: 10,628 Site admin

    You need to create the XML structure requires for an XSLX row. What I would suggest is that you take a look at the row element (just console.log( $('row', sheet)[0] );) and see how it is constructed. You can then use jQuery or DOM methods to create the new row.

    Unfortunately, Buttons doesn't expose the function it uses internally to create nodes, although if you are interested, this is where it does.

    Allan

  • jacobruvalcabajacobruvalcaba Posts: 10Questions: 6Answers: 0

    Awesome, Thanks for the reply.

This discussion has been closed.