surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
896 stars 370 forks source link

V2: Multiple text item ignores both hiding text column from properties and inplaceEditForValues #2973

Open benmoses-equineregister opened 2 years ago

benmoses-equineregister commented 2 years ago

Are you requesting a feature, reporting a bug or ask a question?

Reporting a Bug

What is the current behavior?

Using

Survey.Serializer.findProperty('itemvalue', 'text').visible = false;
creator.inplaceEditForValues = true;

Hides the text field and allows the user to edit the Value directly as if they're 1 property. This works except for multipletextitem and matrix questions (other than single input matrix).

What is the expected behavior?

Both would work with all questions

How would you reproduce the current behavior (if this is a bug)?

https://plnkr.co/edit/nBN7mR6NViheWiFN

Provide the test code and the tested page URL (if applicable)

Tested page URL: https://plnkr.co/edit/nBN7mR6NViheWiFN

Test code

Survey.Serializer.findProperty('itemvalue', 'text').visible = false;

var creator = new SurveyCreator.SurveyCreator({});
creator.inplaceEditForValues = true;
creator.toolboxLocation = "right";

creator.render("creatorElement");

Specify your

benmoses-equineregister commented 2 years ago

Also additional help request - 1) If you could go about describing how I should debug this in future to find why these questions are behaving differently? I assumed they would inherit from question and so changing this property affects them all?

2) If there's any documentation which gives a high level overview of how the creator works / what class/model inherits what? I would appreciate that, right now I'm finding I'm having to search github / google the result I want rather than looking at where a list of properties for a question is defined in the code?

(I'm using creator and react)

andrewtelnov commented 2 years ago

@benmoses-equineregister multiple text item and columns are different from itemvalue. It is different classes. This is all documentation we have at the current moment.

Thank you, Andrew

benmoses-equineregister commented 2 years ago

Thanks for the documentation link 👍

So is it possible to force multiple text item and columns to use 1 value instead of both a name and title value? (If it's not supported can you give any tips on how I might be able to workaround it?) e.g. Current column UI (and the definition) have both name and title, I want to try and get it to behave more like rows / choices where it's just an array of strings, even if that means they cannot have the same column name.

{
  "name": "Column 1",
  "title": "test"
},
benmoses-equineregister commented 2 years ago

I've just realised we wouldn't be able to support visibleIf etc. for columns without the object structure. So ignore that part.

But is it possible to have it so both name and title are kept in sync?