[Ticket cloned from T12563: How to add a custom layout for question properties in Survey JS]
Thanks Jane.
Regarding "Add Row" button will it take more time since it seems that it is not currently available feature in survey js.
Actually this custom dynamic matrix property feature we need on some urgent basis, so is there any way I can tweak the code and dynamically add a row to dynamic matrix? Just want to know the possibilities.
Thanks,
Santosh
Santosh,
We haven't received requests to use a Dynamic Matrix question as a custom property editor. Therefore, to let us consider the best way to handle this task, would you please elaborate on your usage scenario? What setting do you wish to edit with a Dynamic Matrix? How do you plan to store values of this custom property?
I look forward to your reply.
Hi Jane,
We are having a master dropdown in our application as a property based on the selection of this dropdown property we want to populate a dynamic matrix kind of property which will store some configuration in a multi row fashion (this will be configured by user).
Matrix will contain two columns, Survey Question & Options ID. Based on the options id we map in the matrix configuration on the survey runner we will append the options to the specific survey question which has been configured in the matrix.
Result of Matrix will be like below,
[{ question: 'q1', OptionID: 123}, { question: 'q4', OptionID: 456}]
Hope the above statement clarifies the requirement that I have.
Thanks,
Santosh
Hello Santosh,
Thank you for making it clear. It is possible to do. It will require some coding and it is better to re-use some of our base property editor, that we use to edit choices and matrix columns.
However, I have another question for you. Do you want to make it for all questions or only for some of your questions? Do you want to store this information in JSON?
The reason I ask, is the following. It is easy to make this property on the question level: "optionID". The main issue I see with this approach, you can't see all questions with their options Id in one place. To deal with it, I would create a separate tab: "Configuration" where you can map your questions with options. If you need to map all questions then you can use matrix dropdown (row value will be a question name) and one text column is a optionId.
Another Pros for my approach, you don't need to update your JSON if question name is changed, since optionID stores in the question directly.
And another Pros, you can move all your configurations into this tab.
Please discuss this with your Product Manager. I strongly believe you will have a better UI and easy to implement solution.
Thank you,
Andrew
SurveyJS Team
Hi Andrew,
Do you want to make it for all questions or only for some of your questions?
Do you want to store this information in JSON?
Thanks,
Santosh
OK. Then several follow-up questions. Do you have algorithm to find out which question should have optionID and which question should not, or a form/survey creator decides which questions will have options Ids?
Will you have just few questions with option IDs or the most of them will have options IDs?
Are you OK with having optionID property on the question level and "Configuration" tab (similar to localization tabs)?
Thank you,
Andrew
SurveyJS Team
Hi Andrew,
What is the update on Add Row button. I can see the below issue has been closed.
Dynamic Matrix as a custom Property Grid editor: No Add Row option · Issue #3939 · surveyjs/survey-creator · GitHub
Thanks,
Santosh
Hi Santosh,
Thank you for the update. No updates on the Add Row button so far. I closed this issue because it appears that we may need to consider an alternative option to complete the task. However, I shouldn't have closed this thread until we find the solution. I'll reopen this thread for now. To allow us consider the best option to achieve your goal, please address Andrew's questions.
Thank you
Hi Andrew,
Do you have algorithm to find out which question should have optionID and which question should not, or a form/survey creator decides which questions will have options Ids?
Will you have just few questions with option IDs or the most of them will have options IDs?
Are you OK with having optionID property on the question level and "Configuration" tab (similar to localization tabs)?
Thanks,
Santosh
Hi Jane/Andrew,
For now since it is not currently available with Survey JS, I am thinking of adding a custom property of type button which will handle the "Add Row" functionality for me since we need to finish up this development on priority.
Can you guide me with how I can add a custom property of type question?
Thanks,
Santosh
Hello Santosh,
I believe that I understand the task now.
I will make an example with a custom tab where you will see the list of question name/title and options ids for these questions. The tab will display dropdown/checkbox/radiogroup questions only (you can change it by using your custom types). Creator user will not be able to add a new question into this list, it will be a static list on this tab. If a user remove/add a new question or change name (title) of an existing question in the designer tab, then list will be updated on switching the tab automatically accordingly to changes.
Please confirm that you are looking for this solution. You need it in Angular, am I right?
Thank you,
Andrew
SurveyJS Team
Hi Andrew,
Can we not have it in the property tab we see for question on right side? Also we need to have it to be dynamic not static.
We are looking for solution in Angular.
Thanks,
Santosh
Hold,
You wrote that you know questions that needed to have options id. It means there is no way for a user to choose them in drop down. It will be easily to show these questions in the list.
I am talking about having "Configuration" tab, similar to "Translation" or "Logic" tab. In this tab you will have matrix dropdown like this.
On changing Option Id, question "optionID" property will be changed. If the property is already set, then it will be displayed initially in this matrix.
Your Creator user will be able to change question OptionID in the question property grid as well.
I strongly believe that this UI is better.
Thank you,
Andrew
SurveyJS Team
Hi Andrew,
We have to handle one more scenario over here,
As shown in the diagram the optionsID list will also be dynamic based on the value we select in the master dropdown I have shown in the image. That's the reason I wanted to club these two controls together (Right now we have Master Dropdown implemented in General Tab).
Thanks,
Santosh
Yes, it is fine. I can do it. What the master dropdown does? Does it filter questions?
I can show create a master dropdown that will have 4 options in my examples: "Show all questions", "Checkboxes", "Raiogroups" and "Dropdowns".
Thank you,
Andrew
SurveyJS Team
Hi Andrew,
It is kind of option category options. Based on the category we select in Master Dropdown, dropdown options of the columns which we have in matrix gets changed. So it is kind of category decider for matrix column options.
Thanks,
Santosh