Giter Site home page Giter Site logo

Comments (10)

realLiangshiwei avatar realLiangshiwei commented on May 28, 2024

This situation was found after ABP upgraded Blazorise to 1.5.0, and since ABP allows dynamic configuration of columns, we encountered duplicate columns.

image

from blazorise.

David-Moreira avatar David-Moreira commented on May 28, 2024

@stsrki Not wanting to be that "told you so" person, but I will be:
image

Please advise since originally you asked for it to be magical, instead of opt in.
#3579


@realLiangshiwei As a workaround you can probably set some dummy invisible column to trick the system into not auto generating.
image

from blazorise.

stsrki avatar stsrki commented on May 28, 2024

I still believe we should do the "magic" and assume that if no columns are defined, they should be autogenerated. In the users provided example, they use the TItem, and later, they manually add columns that are already in the IItem model. Maybe in this scenario, it makes more sense to hide or show columns by using the new ColumnChooser feature?

from blazorise.

David-Moreira avatar David-Moreira commented on May 28, 2024

Well I have to disagree. Because we want the magic, then the user has to do figure out how to work around it. I'm still of the original belief with the explicit opt in. Or at least able to turn it off.

Anyway, now we went this route, and we need to find sound solutions... :)

Maybe in this scenario, it makes more sense to hide or show columns by using the new ColumnChooser feature?

Can you further explain what this entails?
The ColumnChooser is mainly an end user feature (the user that uses the UI).
Are you suggesting that the programmer will hide them programmatically, or is the end user with the UI?

Let's stay, for example, I have 100 properties in the Item (I'm exagerating of course...), should I have to pay the cost for the 100 columns and then hide them?

from blazorise.

realLiangshiwei avatar realLiangshiwei commented on May 28, 2024

I'm still of the original belief with the explicit opt in. Or at least able to turn it off.

Yes, an option to turn it off would be useful.

from blazorise.

stsrki avatar stsrki commented on May 28, 2024

I mean to use ColumnChooser programmatically. But we only have that option in the next 1.6 with #5404. And it is done through the state management. So it is not possible at the moment.

We could introduce an opt-out API, but should we use it in the current 1.5?

@realLiangshiwei, did you try the workaround that David suggested?

from blazorise.

realLiangshiwei avatar realLiangshiwei commented on May 28, 2024

did you try the workaround that David suggested?

This is a workaround, and yes, it works. I just think this code is a bit ugly

from blazorise.

David-Moreira avatar David-Moreira commented on May 28, 2024

We could introduce an opt-out API, but should we use it in the current 1.5?

Well I would say that this is basically the AutoGenerateColumns initially proposed? Just that it's set to true by default. I don't see why not. It's flexibility without any real cost.

If you told me that adding the Parameter add any big downside... It seems like we are enforcing the "magic" just because we want to. Well we can enforce it by default, but let the user have something like AutoGenerateColumns so he can just do AutoGenerateColumns=false.

As usual I prefer to add it in v1.6 since there's indeed a workaround even though it's not super elegant.
But the change is so simple it wouldn't hurt to do it in v1.5, again, I personally just don't like new apis popping up mid release if not absolutely necessary.

So go ahead and let me know if you finally agree with the Parameter, or if you have any other idea, and what version would you prefer to do this on.

from blazorise.

stsrki avatar stsrki commented on May 28, 2024

You have convinced me. Do the change in 1.5, and if it is not too big, once I review, then it will be merged in.

The API will be AutoGenerateColumns and, by default, is enabled.

from blazorise.

stsrki avatar stsrki commented on May 28, 2024

@David-Moreira reminder

from blazorise.

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.