Code Monkey home page Code Monkey logo

Comments (12)

vnbaaij avatar vnbaaij commented on July 25, 2024

No, we are not going to change that logic. Even if the result is that no rows are being returned, the grid is then no longer in a Loading state. It is not on us to interpretate if that is a satisfactory result or not.

from fluentui-blazor.

ArturMichalak avatar ArturMichalak commented on July 25, 2024

Do you have any other idea to bypass the problem with req.Count as null?

from fluentui-blazor.

vnbaaij avatar vnbaaij commented on July 25, 2024

I think that is something that needs to be handled on 'your' side. We can't determine what is right or wrong when null is returned.

from fluentui-blazor.

ArturMichalak avatar ArturMichalak commented on July 25, 2024

Perhaps there was a small misunderstanding.
I would like to deal with invalid input parameters on "my side" (e.g. req.Count is null) but I can't as after every ItemsProvider call the loading indicator disappears and doesn't open when ItemsProvider called again.

private GridItemsProvider<RowDto> InitialProvider => async req =>
{
    try
    {
        _grid.SetLoadingState(true);
        if (req.Count is null) throw new OperationCanceledException();
        var results = await new GridCommand(args).Execute(req.CancellationToken);
        return GridItemsProviderResult.From(
            items: results.Items,
            totalItemCount: results.TotalItemCount
        );
    }
    catch (OperationCanceledException ex) {}

    return GridItemsProviderResult.From(
        items: Array.Empty<RowDto>(),
        totalItemCount: -1
    );
};

from fluentui-blazor.

vnbaaij avatar vnbaaij commented on July 25, 2024

The disappearing of the loading indicator is by design. The provider has retuned, so loading is done.

from fluentui-blazor.

ArturMichalak avatar ArturMichalak commented on July 25, 2024

So in the case of using the Virtualize parameter, which gives req.Count as null on the first load? Should I use an external loading indicator?

from fluentui-blazor.

vnbaaij avatar vnbaaij commented on July 25, 2024

No, you should anticipate on that first request returning null. You know that will always be the case.

from fluentui-blazor.

ArturMichalak avatar ArturMichalak commented on July 25, 2024

At this moment, I have no way to handle it.
I tried with OnAfterRender, loading flags, etc., but nothing worked.

from fluentui-blazor.

vnbaaij avatar vnbaaij commented on July 25, 2024

Sorry to hear that. Up until now, there has been no issues/discussions around this. You must have a pretty unique use case.

from fluentui-blazor.

ArturMichalak avatar ArturMichalak commented on July 25, 2024

I will make a reproduced example and report the bug issue if it is not a problem.

from fluentui-blazor.

vnbaaij avatar vnbaaij commented on July 25, 2024

Sure, no problem. But as this is one of the most used (and most complex) components, we will be very careful to not have any breaking changes. So no guarantee that your issue can or will be resolved.

And please create a new issue so we don't have all the bagage from the discussions in this one :)

from fluentui-blazor.

ArturMichalak avatar ArturMichalak commented on July 25, 2024

Of course!

from fluentui-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.