Giter VIP home page Giter VIP logo

Comments (4)

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

Hello @joergkrause
It's verified that the object reference for the Selected Item is not contained in the AllItems.
I have to say, I don't fully understand how that library works behind the scenes, but if new object references are being generated, I guess this can happen.

I solved your issue by just loading the data outside of the MediaR usage. This makes sure the object references don't change.
image
image

So it seems like to me that the DataGrid is working as expected with what's bound reference wise.

Let us know if this helps.

from blazorise.

joergkrause avatar joergkrause commented on May 30, 2024

Thanks for digging into this. It's weird that I used Fluxor now whoch has a similar approach and don't see the effect there. I'm going to reach out to the MediatR guys to see whether they can have a look.
However, the approach to exclude the data from state feels wrong and makes the whole code more complex.

Also, as far as I remember in Blazor the @key property can be set to anything to handle such scenario. Would that be possible in the Grid here?

from blazorise.

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

Thanks for digging into this. It's weird that I used Fluxor now whoch has a similar approach and don't see the effect there. I'm going to reach out to the MediatR guys to see whether they can have a look.

Well I guess you're just further concluding that something with the MediatR internals works differently then what we would be expecting. I'm guessing it somehow produces different in memory references. I would expect that they would be the same, but maybe that's something that can be configurable, or maybe even a conscious part of their implementation for some special reason.

I would try to focus on the MediaR object reference thing, and show them an example where the original reference you gave it is lost. I would make sure you take as many things out of the equation as possible and nothing in your code is producing those "unexpected" results before giving them the example.
Keep us updated.


This Key implementation would be different then the @key property reserved for Blazor.
It could also be named Id, but I think Key better represents it. I'm thinking that you could even bind something like a complex key or something. So Func<TItem,object> would work nicely I think?
It does not necessarily need to be named Key either, we usually use verbs as suffixs to represent Func, i.e KeyGetter KeyAccessor etc..

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.