Hello,
I am using a TreeList to allow users to configure a Question and Answer tree. The user needs to be able to add a question row, then a list of potential answers (these are multiple choice questions) and then under each answer add a follow up question that should be asked in the event that that answer is selected.
Ideally, when a user creates a new question row, he would be presented with 3 or 4 editable rows - the top one intended to be the text of the question and then the additional rows to supply the answer choices for that question so that he can add questions AND answers with just one operation. So my first question is whether this is possible at all in TreeList (my attempts to call addRow() multiple times have not been successful).
If giving the user multiple editable rows all at once is not an option, then the second-best thing would be to automatically create some "default" answers in the database (I am using a remote datasource with this TreeList) and then upon the Create operation completing, show the new question they've added to the list as well as the two default answer rows below it. I have attempted this as well - when the transport Create operation is called, 3 new records are created in the database (the latter two records having a "parent" value of the ID of the first one), and I am returning JSON containing all 3 rows. The new question row then shows on the TreeList, but the new answers do not get added. I can collapse and re-expand the tree, but they still do not show up until I refresh the page and the TreeList loads from scratch again. So my second question is is it possible to have one transport create operation add multiple rows to the tree and have them be displayed immediately upon completion of the operation.
Thank you.