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

feat: Add multi line text to FluentDataGrid PropertyColumn #419

Closed
Ogglas opened this issue Jun 1, 2023 · 4 comments
Closed

feat: Add multi line text to FluentDataGrid PropertyColumn #419

Ogglas opened this issue Jun 1, 2023 · 4 comments
Labels
closed:not-actionable There is no action to be taken in response to this issue.

Comments

@Ogglas
Copy link
Contributor

Ogglas commented Jun 1, 2023

🙋 Feature Request

Add the possibility to use multi line text to FluentDataGrid PropertyColumn

😯 Current Behavior

Currently text-overflow: ellipsis; is always used.

fluent-data-grid-cell[b-58jkn3no8z] {
    text-overflow: ellipsis;
}

💁 Possible Solution

My current solution that works but I would rather have a setting for it:

app.css:

.datagrid-multiline-text {
    white-space: inherit;
    overflow: auto; /*Only used for virtualized table with fixed height*/
}

Component:

<FluentDataGrid RowsData="@people">
    <PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
    <PropertyColumn Property="@(p => p.Name)" Sortable="true" />
    <PropertyColumn Property="@(p => p.Description)" Sortable="true" Class="datagrid-multiline-text" />
</FluentDataGrid>

@code {
    record Person(int PersonId, string Name, string Description);

    IQueryable<Person> people = new[]
    {
        new Person(10895, "Jean Martin", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
        new Person(10944, "António Langa", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
        new Person(11203, "Julie Smith","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
    }.AsQueryable();
}
@vnbaaij
Copy link
Collaborator

vnbaaij commented Jun 1, 2023

Hi Oscar,

We are staying very close to the original QuickGrid with the FluentDataGrid. This so we can upgrade with ease when new versions/bug fixes come out. We will therefore not be adding this. Think the Class way of solving this is a good enough solution here.

@vnbaaij vnbaaij closed this as completed Jun 1, 2023
@vnbaaij vnbaaij added the closed:not-actionable There is no action to be taken in response to this issue. label Jun 1, 2023
@vnbaaij
Copy link
Collaborator

vnbaaij commented Jun 2, 2023

After some rethinking...I can add a class to the isolated css and include your sample using that class on the demo page. Thoughts?

@vnbaaij
Copy link
Collaborator

vnbaaij commented Jun 2, 2023

Sample has been added:

image

with this razor file (multiline-text css class has been added to FluentDataGridCell.razor.css:

<FluentDataGrid RowsData="@people">
    <PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
    <PropertyColumn Property="@(p => p.Name)" Sortable="true" />
    <PropertyColumn Property="@(p => p.Description)" Sortable="true" Class="multiline-text" />
</FluentDataGrid>

@code {
    record Person(int PersonId, string Name, string Description);

    IQueryable<Person> people = new[]
    {
        new Person(10895, "Jean Martin", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
        new Person(10944, "António Langa", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
        new Person(11203, "Julie Smith","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."),
    }.AsQueryable();
}

vnbaaij added a commit that referenced this issue Jun 2, 2023
* Fix #418

* Add a ccs class to enable grid to show multiple lines of text. Partialy fix #419
vnbaaij added a commit that referenced this issue Jun 4, 2023
* Fix #418

* Add a ccs class to enable grid to show multiple lines of text. Partialy fix #419
vnbaaij added a commit that referenced this issue Jun 4, 2023
* Fix #418

* Partialy fix #419 Add a ccs class to enable grid to show multiple lines of text.

* Fix #424: Infinite rendering loop in TableOfContents

* Fix #422 Demo site not working on iPhone
@Ogglas
Copy link
Contributor Author

Ogglas commented Jun 5, 2023

Tried the sample in V2.3.5 and it works as expected. Nice addition! :)

image

@vnbaaij vnbaaij mentioned this issue Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:not-actionable There is no action to be taken in response to this issue.
Projects
None yet
Development

No branches or pull requests

2 participants