Adding data row

I’m currently using this code to add a data row to my data source


set theDataRow to make new data row at end of data rows of theDataSource

This works, but I would rather add the data row to the front of the list, not the end. I tried the following code, but got an error. Is there any way to create the new row at the start and have it push the other rows down?


set theDataRow to make new data row at start of data rows of theDataSource

Thanks,
Dave

Try “beginning” instead of ‘start’.

j

So simple and exactly what I was looking for!

Thanks,
Dave

Can you specify a position in the data source or does it have to be either at the end, or the beginning?

Thanks!

Ah yes of course, that makes sense, I’ll give it a try!

Thanks!

That works a treat - I do have one last hurdle though, how can I get the integer value of a row?

The reason I ask is after inserting a data row, I want to jump into edit mode on that particular row, which means I need to select the row and then use a call method on it, however both of these options seem to want an integer value for the row :S

Any ideas again?

Thanks!

Thanks! That works as expected - my only remaining issue is putting that all together so that I can insert the new data row at a specific row number - which I am trying to obtain through the users current selection.

So basically I need to insert a new row at their current selection, but that seems to require and integer, and I can’t seem to get an integer value from the current selected rows :S

Thanks for the help!

That’s fantastic, thanks very much!

I was getting it returning a 1 item list still, but I changed the line to be within the tell block and it returned an integer instead, perfect!

Thanks again.