Giter VIP home page Giter VIP logo

Comments (8)

fretje avatar fretje commented on June 16, 2024

I think you have to bind with something on context (which is of type TRequest)... the editformcontent is passed on to the addeditmodal so not sure it can access private fields on the component where your table is defined... It might with a well placed Context.AddEditModal.ForceRender() maybe? (Although probably not in your case... binding back to the property)

The EntityTable (and AddEditModal) are not really ready for prime time yet... I don't like the current design. I'll probably do it over in a while... I already have a much better understanding of the blazor and mudblazor innards now... just have to find time for it ;-)

from blazor-wasm-boilerplate.

anasseb avatar anasseb commented on June 16, 2024

Thanks for your response.
The problem that I have is that the model doesn't know if the value is changed.
For exemple hiding and showing a text field based on the switch value.
I already tested it with the context but nothing works.
It's really a serious problem, no one is able to use a switch or even a checkbox (not working too)

I liked the Blazor Hero project design, really simple to use and understanding

from blazor-wasm-boilerplate.

fretje avatar fretje commented on June 16, 2024

Hmm... There must be something else going on...

I've been working with checkboxes and all kinds of controls on the dialog without any problems.

I guess you're gonna have to show some code...

from blazor-wasm-boilerplate.

anasseb avatar anasseb commented on June 16, 2024

I did some changes, now I see the value changing, but ...

I have a text field that I want to enable and disable according to the switch value, that happen only if the switch lose focus 😔

<MudItem xs="12" md="6"> <MudSwitch @bind-Checked="@context.IsDelivery" ThumbIcon="@Icons.Filled.DeliveryDining" Color="Color.Primary" ThumbIconColor="Color.Dark">@(context.IsDelivery ? "Delivery" : "Not delivery")</MudSwitch> </MudItem>

<MudItem xs="12" md="12"> <MudTextField Disabled="@context.IsDelivery" For="@(() => context.DeliveryAddress)" @bind-Value="@context.DeliveryAddress" Label="@L["DeliveryAddress"]" Lines="3" /> </MudItem>

from blazor-wasm-boilerplate.

fretje avatar fretje commented on June 16, 2024

Seems strange indeed... like I said... I have dialogs with checkboxes that hide and show other things on the dialog without any issues... so still... gonna have to see more code to be able to help.
Maybe try with a regular MudTable (or FshTable) first, instead of EntityTable?

from blazor-wasm-boilerplate.

anasseb avatar anasseb commented on June 16, 2024

OMG finally I found how to solve it.

I removed the @bind-Checked and replace it with CheckedChanged with a function as a parameter, and I was forced to specify the return type with T="bool" (not working without it)

<MudItem xs="12" md="6"> <MudSwitch T="bool" CheckedChanged="ChangeDel" Checked="@context.IsDelivery" ThumbIcon="@Icons.Filled.DeliveryDining" Color="Color.Primary" ThumbIconColor="Color.Dark">@(context.IsDelivery ? "Delivery" : "Not delivery")</MudSwitch> </MudItem>

<MudItem xs="12" md="12"> <MudTextField Disabled="@context.IsDelivery" @bind-Value="@context.DeliveryAddress" Label="@L["DeliveryAddress"]" Lines="3" /> </MudItem>

public void ChangeDel() { Context.AddEditModal.RequestModel.IsDelivery = !Context.AddEditModal.RequestModel.IsDelivery; Context.AddEditModal.ForceRender(); }

With that, the context is updated without losing focus

from blazor-wasm-boilerplate.

fretje avatar fretje commented on June 16, 2024

Glad you found a solution!

Little github tip: you can add blocks of code with tripple backticks above and below. You can even specify c# right next to the top tripple backticks to make it colorful:

Console.WriteLine("Hello world!");

;-)

from blazor-wasm-boilerplate.

anasseb avatar anasseb commented on June 16, 2024

Thank you ☺

from blazor-wasm-boilerplate.

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.