Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe transposeData #7835

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/question_matrixdropdownbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -959,19 +959,21 @@ export class QuestionMatrixDropdownModelBase extends QuestionMatrixBaseModel<Mat
this.clearRowsAndResetRenderedTable();
}
}
/**
* Specifies whether to display [`columns`](#columns) as rows and [`rows`](#rows) as columns.
*
* Default value: `false`
*
* [View Demo](https://surveyjs.io/form-library/examples/transpose-dynamic-rows-to-columns-in-matrix/ (linkStyle))
*/
public get transposeData(): boolean {
return this.getPropertyValue("transposeData");
}
public set transposeData(val: boolean) {
this.setPropertyValue("transposeData", val);
}
/**
* Specifies the matrix layout. Set this property to `"vertical"` if you want to display columns instead of rows and rows instead of columns.
*
* Default value: `"horizontal"`
* @see columns
* @see rows
* @see isColumnLayoutHorizontal
* This property is obsolete. Use the [`transposeData`](#transposeData) property instead.
*/
public get columnLayout(): string {
return this.transposeData ? "vertical" : "horizontal";
Expand Down Expand Up @@ -1023,9 +1025,9 @@ export class QuestionMatrixDropdownModelBase extends QuestionMatrixBaseModel<Mat
return super.getChildErrorLocation(child);
}
/**
* Returns `true` if columns are placed in the horizontal direction and rows in the vertical direction.
* Returns `true` if [`columns`](#columns) are placed in the horizontal direction and [`rows`](#columns) in the vertical direction.
*
* To specify the layout, use the `transposeData` property. If you set it to `true`, the survey applies it only when the screen has enough space. Otherwise, the survey falls back to the horizontal layout, but the `transposeData` property remains set to `true`. Unlike `transposeData`, the `isColumnLayoutHorizontal` property always indicates the current layout.
* To specify the layout, use the [`transposeData`](#transposeData) property. If you set it to `true`, the survey applies it only when the screen has enough space. Otherwise, the survey falls back to the original layout, but the `transposeData` property remains set to `true`. Unlike `transposeData`, the `isColumnLayoutHorizontal` property always indicates the current layout.
* @see transposeData
*/
public get isColumnLayoutHorizontal(): boolean {
Expand Down
5 changes: 2 additions & 3 deletions src/question_matrixdynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export class QuestionMatrixDynamicModel extends QuestionMatrixDropdownModelBase
return res;
}
/**
* Specifies whether users can drag and drop matrix rows to reorder them. Applies only if [`columnLayout`](#columnLayout) is `"horizontal"`.
* Specifies whether users can drag and drop matrix rows to reorder them. Applies only if [`transposeData`](#transposeData) is `false`.
*
* Default value: `false`
*/
Expand Down Expand Up @@ -654,8 +654,7 @@ export class QuestionMatrixDynamicModel extends QuestionMatrixDropdownModelBase
* - `"bottom"` - Displays the Add Row button at the bottom of the matrix.
* - `"topBottom"` - Displays the Add Row button at the top and bottom of the matrix.
*
* Default value: `"top"` if `columnLayout` is `vertical`; `"bottom"` if `columnLayout` is `"horizontal"` or the matrix is in compact mode.
* @see columnLayout
* Default value: `"top"` if [`transposeData`](#transposeData) is `true`; `"bottom"` if `transposeData` is `false` or the matrix is in compact mode.
* @see addRowText
*/
public get addRowLocation(): string {
Expand Down
Loading