Git Product home page Git Product logo

Comments (5)

StevenRasmussen avatar StevenRasmussen commented on June 7, 2024 1

I feel like you wouldn't want to mix/match specifying the width at the column level AND with the GridTemplateColumns. I feel like it should be one OR the other. If we assume that, then we could provide logic that would throw an error if they tried to specify it in both places. Thoughts?

from fast-blazor.

StevenRasmussen avatar StevenRasmussen commented on June 7, 2024 1

Sorry... I haven't been very clear in what I was thinking with regards to the design around this. I'm not suggesting that we remove the GridTemplateColumns parameter. My suggestion is that we either:

  1. Use the user supplied GridTemplateColumns parameter and pass it to the underlying web component.
  2. OR dynamically generate a GridTemplateColumns parameter based on the individual values supplied by each column (or use a default of auto for any columns that do not have it specified) and pass that down to the web component.

Some pseudo code of the logic (I apologize for any incorrect syntax or spelling errors... just typing it out here):

if(!string.IsNullOrWhitespace(grid.GridTemplateColumns) && grid.Columns.Any(x => !string.IsNullOrWhitespace(x.Width))
{
    throw new Exception("You can only specify either the 'GridTemplateColumns' property on the grid, or the 'Width' property at the column level, not both.");
}

var gridTemplateColumnsToPassToWebComponent = grid.GridTemplateColumns;
if(string.IsNullOrWhitespace(gridTemplateColumnsToPassToComponent) && grid.Columns.Any(x => !string.IsNullOrWhitespace(x.Width))
{
    gridTemplateColumnsToPassToWebComponent = string.Join(" ", grid.Columns.Select(x => x.Width ?? "auto"));
}

// Pass the `gridTemplateColumnsToPassToWebComponent` down to the web component
...

Hopefully that makes sense. Doing it this way would not introduce a breaking change. Thoughts?

from fast-blazor.

dvoituron avatar dvoituron commented on June 7, 2024

This would be possible, but would conflict with the existing GridTemplateColumns property.
For example, how to handle a mix of Width properties with values already specified for GridTemplateColumns.
I think it would be more appropriate to consider this change in a future major update.

We need to think about a solution that doesn't involve Breaking Change.

from fast-blazor.

vnbaaij avatar vnbaaij commented on June 7, 2024

With the current rendering method (using the web components) we always need the GridTemplateColumn parameter.
That is why removing it would be a breaking change

from fast-blazor.

dvoituron avatar dvoituron commented on June 7, 2024

Yep. That could be a solution

from fast-blazor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.