Skip to content

Docs GridLayout #365

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

Merged
merged 9 commits into from
Jun 22, 2021
Merged

Docs GridLayout #365

merged 9 commits into from
Jun 22, 2021

Conversation

svdimitr
Copy link
Contributor

@svdimitr svdimitr commented Jun 21, 2021

New Component Checklist (delete for other types of PRs)

  • - Overview article

    • General information on the purpose of the component.
    • Instruction on how to add the component to a razor component.
    • Basic configuration of the component - code snippet with a scenario that is both basic, and meaningful.
    • Provide information on the component's reference.
    • List the available features for the component and/or provide links (slugs) for the articles that explain them in details. For simpler components listing parameters might be enough, for more complex ones sections with a sentence or two that links corresponding articles might be more suitable.
    • Maybe some Example(s) - very common scenarios, notes, typical use case, etc. Not mandatory, depends on the component.
  • - Data binding article - applicable if data can be provided to the component. My be one article or a folder with several articles (examples - DropDownList and TreeView)

  • - Feature/component specific articles - those articles explain the component specific features, which do not suit in any of the before-mentioned articles. Examples of such articles are the Navigator for the Stock Chart, the Indeterminate state for the CheckBox and others.

  • - Selection article - applicable if the component exposes items selection. May be a folder.
    [ ] - Single item selection
    [ ] - Multiple item selection

  • - Templates - applicable if additional customization is allowed with Templates. Usually a folder, see the grid

  • - Events article - applicable if the component expose events.
    Examples of such events could be:

  • OnClick
  • OnChange
  • ValueChanged
  • SelectedItemsChanged
  • OnRead
  • etc.
  • Update Input Validation, Globalization, Keyboard Navigation, Accessibility Compliance articles as applicable.

  • Link from the Overview components list

@svdimitr svdimitr self-assigned this Jun 21, 2021
@svdimitr svdimitr requested a review from a team June 21, 2021 12:48
---
title: Overview
page_title: GridLayout Overview
description: Overview of the GridLayout for Blazor.
Copy link
Contributor

@dimodi dimodi Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use different keywords in the different meta elements.

Suggested change
description: Overview of the GridLayout for Blazor.
description: Introduction to the GridLayout for Blazor. The component provides a CSS grid system.


## Basics

#### To use a Telerik GridLayout for Blazor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are skipping one heading level here (## -> ####). Is a heading needed at all?

Suggested change
#### To use a Telerik GridLayout for Blazor
To use a Telerik GridLayout for Blazor:


1. Declare the `<TelerikGridLayout>` tag

1. To define columns in the GridLayout add one or more instances of the `<GridLayoutColumn>` to the `<GridLayoutColumns>` collection.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. To define columns in the GridLayout add one or more instances of the `<GridLayoutColumn>` to the `<GridLayoutColumns>` collection.
1. To define columns in the GridLayout, add one or more `<GridLayoutColumn>` tags to the `<GridLayoutColumns>` collection.


1. To define columns in the GridLayout add one or more instances of the `<GridLayoutColumn>` to the `<GridLayoutColumns>` collection.

* The number of `<GridLayoutColumn>` should be the same as the number of the `<GridLayoutItem>`.
Copy link
Contributor

@dimodi dimodi Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not true if ColumnSpan is used, right?

Suggested change
* The number of `<GridLayoutColumn>` should be the same as the number of the `<GridLayoutItem>`.
* The number of `<GridLayoutColumn>`s should match the number of `<GridLayoutItem>`s. If [items span across multiple columns]({%slug gridlayout-items %}#columnspan), then the columns can be more than the items.


* The number of `<GridLayoutColumn>` should be the same as the number of the `<GridLayoutItem>`.

1. To define rows in the GridLayout add one or more instances of the `<GridLayoutRow>` to the `<GridLayoutRows>` collection.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. To define rows in the GridLayout add one or more instances of the `<GridLayoutRow>` to the `<GridLayoutRows>` collection.
1. To define rows in the GridLayout, add one or more `<GridLayoutRow>` tags to the `<GridLayoutRows>` collection.


1. To define rows in the GridLayout add one or more instances of the `<GridLayoutRow>` to the `<GridLayoutRows>` collection.

1. Provide one or more instances of the `<GridLayoutItem>` to the `<GridLayoutItems>` collection.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Provide one or more instances of the `<GridLayoutItem>` to the `<GridLayoutItems>` collection.
1. Define one or more `<GridLayoutItem>` tags in the `<GridLayoutItems>` collection.


* [Features](#features)

## Basics
Copy link
Contributor

@dimodi dimodi Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this section we explain how rows, columns and items are defined. It becomes clear that the number of columns should match the number of items. However, it doesn't become clear if rows are required or not. Also, what happens if multiple rows are defined?

![overview of the GridLayout functionality](images/gridlayout-overview-basic-example.png121)


>caption Component namespace and reference
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This second snippet brings little value, but expands the article length. It can be merged with the first one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a common practice across our documentation, to add a snippet that showcases the namespace and reference. I would rather leave it there.


## Features

The StackLayout offers the following features:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are introducing a StackLayout term, which has not been defined. Is this a typo? Is this a feature of the GridLayout? Is this a separate component? How does it fit in the above information and snippets?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it is a typo. Will be fixed with the rest of the improvements based on your feedback


* `Width`- takes a CSS unit that determines how wide the GridLayout is. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.

* `ColumnSpacing` - controls the space between the columns in the GridLayout. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have already linked the Dimensions article.

Suggested change
* `ColumnSpacing` - controls the space between the columns in the GridLayout. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.
* `ColumnSpacing` - controls the space between the columns in the GridLayout. Use a CSS length unit.


* `Class` - the CSS class that renders on the main wrapping element of the component.

* `Width`- takes a CSS unit that determines how wide the GridLayout is. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.
Copy link
Contributor

@dimodi dimodi Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integers and doubles are valid CSS units, but not supported here, as far as I understand. That is why we specify what units we require.

Suggested change
* `Width`- takes a CSS unit that determines how wide the GridLayout is. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.
* `Width`- takes a CSS length unit that determines how wide the GridLayout is. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.


* `ColumnSpacing` - controls the space between the columns in the GridLayout. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.

* `RowSpacing` - controls the space between the rows in the GridLayout. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `RowSpacing` - controls the space between the rows in the GridLayout. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.
* `RowSpacing` - controls the space between the rows in the GridLayout. Use a CSS length unit.


* `RowSpacing` - controls the space between the rows in the GridLayout. See the [Dimensions]({%slug common-features/dimensions%}) article for more details on what units you can use and how dimensions in percent work.

* `HorizontalAlign` - controls the alignment of the inner items in the GridLayout column based on the X axis. Takes a member of the `GridLayoutHorizontalAlign` enum:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which are the inner items and which are the "outer" items?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inner items are all s defined. They are inner to the component

---
title: Items
page_title: GridLayout Items
description: Items in the GridLayout for Blazor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Items in the GridLayout for Blazor.
description: Usage of layout items in the GridLayout for Blazor.


# Items

The you can control the items in the GridLayout with the parameters they expose:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The you can control the items in the GridLayout with the parameters they expose:
You can control the items in the GridLayout with the parameters they expose:


## Row

The `Row` parameter controls in which row the `GridLayoutItem` will reside. The rows in the component are `1-based`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if a Row is not set?


## Column

The `Column` parameter controls in which row the `GridLayoutItem` will reside. The columns in the component are `1-based`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `Column` parameter controls in which row the `GridLayoutItem` will reside. The columns in the component are `1-based`.
The `Column` parameter controls in which column the `GridLayoutItem` will reside. The columns in the component are `1-based`.

</TelerikGridLayout>
````

## Column
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if a Column is not set?


## ColumnSpan

The `ColumnSpan` parameter defines the column span that the item will occupy.
Copy link
Contributor

@dimodi dimodi Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain terms with different words, otherwise the explanation becomes unnecessary.

Suggested change
The `ColumnSpan` parameter defines the column span that the item will occupy.
The `ColumnSpan` parameter defines how many columns the item will occupy.


## RowSpan

The `RowSpan` parameter defines the row span that the item will occupy.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `RowSpan` parameter defines the row span that the item will occupy.
The `RowSpan` parameter defines how many rows the item will occupy.

}
````

## Example: Complex Grid Layout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the pros and cons of using a GridLayout vs a Splitter layout?


## Example: Complex Grid Layout

You can use the parameter exposed for the GridLayout items to create more complex layouts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can use the parameter exposed for the GridLayout items to create more complex layouts.
You can use the exposed parameters of the GridLayout items to create more complex layouts.

Comment on lines 230 to 232
>caption Create a page layout with the GridLayout component. The result from the code snippet below

![complex layout](images/gridlayout-complex-example.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>caption Create a page layout with the GridLayout component. The result from the code snippet below
![complex layout](images/gridlayout-complex-example.png)
![complex layout](images/gridlayout-complex-example.png)
>caption Create a page layout with the GridLayout component

public string MyImageUrl { get; set; }
}

public IEnumerable<SampleData> MyData = Enumerable.Range(1, 30).Select(x => new SampleData
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MyData and SampleData are not intuitive names when using multiple components and multiple data sources.

Copy link
Contributor

@dimodi dimodi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some improvement suggestions for the language, explanations and code.

@svdimitr svdimitr requested a review from dimodi June 22, 2021 08:12

## Column

The `Column` parameter controls in which column the `GridLayoutItem` will reside. The columns in the component are `1-based`. If not columns are set the GridLayout items will be grouped in one column.
Copy link
Contributor

@dimodi dimodi Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `Column` parameter controls in which column the `GridLayoutItem` will reside. The columns in the component are `1-based`. If not columns are set the GridLayout items will be grouped in one column.
The `Column` parameter controls in which column the `GridLayoutItem` will reside. The column indexes in the component are `1-based`. If no columns are defined, the GridLayout items will be displayed in one column.


## Row

The `Row` parameter controls in which row the `GridLayoutItem` will reside. The rows in the component are `1-based`. If not rows are defined the items will be grouped in one column with `n` rows where `n` is the number of items.
Copy link
Contributor

@dimodi dimodi Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `Row` parameter controls in which row the `GridLayoutItem` will reside. The rows in the component are `1-based`. If not rows are defined the items will be grouped in one column with `n` rows where `n` is the number of items.
The `Row` parameter controls in which row the `GridLayoutItem` will reside. The row indexes in the component are `1-based`. If no rows are defined, the items will be displayed in `r = i / c` rows, where:
* `r` is the number of rows;
* `i` is the number of items;
* `c` is the number of columns;

Copy link
Contributor

@dimodi dimodi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the suggestion about the scenario when no rows are defined.

@svdimitr svdimitr merged commit 6a490e4 into master Jun 22, 2021
@svdimitr svdimitr deleted the gridlayout-docs branch June 22, 2021 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants