How would one access either the index, or the data of the row being opened in the Editor Form?

How would one access either the index, or the data of the row being opened in the Editor Form?

tigersheeptigersheep Posts: 1Questions: 1Answers: 0
edited July 2014 in Editor

I have an interesting use case for the editing form.

When you click to create or edit a new row, I'm inserting a tiny DataTable inside the form via the open event. This is to show a list related to the data in the row the user selected. I'm setting some events and other things on a 'mini form' inside the actual editing form, including another input, and a button to add data to the list.

Is there any way that I'd be able to access the data that is used to fill the form in the open event? Is there a standard way of accessing this data?

What I'd like to do is be able to use the extra DataTable inside the parent form to select and delete items from that little mini DataTable inside the editing form. And if a user were to type in some data in the text input and click the button, have it appended to the list of data on the DataTable inside the form.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,765Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Hi,

    Great use case :-).

    There actually isn't a nice simple API for accessing which row is currently being edited - there should be though and I'll look at adding that for the next release.

    Until then, what you could do is use the initEdit event which does give you the row that is being used for editing and the data object for that row. initEdit will run a little bit before open (event sequence) but the basic idea should be the same.

    Regards,
    Allan

  • tigersheeptigersheep Posts: 1Questions: 1Answers: 0

    Awesome!

    Thanks, Allan, I appreciate the help. I'll share my code once I have it implemented.

  • tigersheeptigersheep Posts: 1Questions: 1Answers: 0

    Awesome!

    Thanks, Allan, I appreciate the help. I'll share my code once I have it implemented.

  • QuaselQuasel Posts: 18Questions: 3Answers: 0

    could use your code - no reinventing ;) if possible ^^

This discussion has been closed.