Comments (8)
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.
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.
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.
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.
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.
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.
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.
Thank you ☺
from blazor-wasm-boilerplate.
Related Issues (20)
- Resend user email confirmation
- validation not working HOT 1
- The MudDatePicker does not work in the dialogbox HOT 2
- API error messages not getting passed HOT 10
- Make Superadmin role for tenants management
- Search product by Brand name doesnot work
- Cannot login using administrator credentials HOT 15
- Web-api giving exception on clicking Dashboard in Blazor frontend HOT 3
- "TypeError: Failed to fetch" error HOT 1
- HamburgerMenu Bug
- What is the difference between these two projects? I am confused
- MudTable to MudDataGrid HOT 1
- Why does the registration page keep redirecting to the login page as soon as button pressed ? HOT 1
- How to create menu Item on Table. HOT 1
- How to update FSHAPI.cs? HOT 2
- Issue with release builds/publish
- Unable to resolve nuget packages
- How to delete selected items only in EntityTable grid
- How to get selected items from the Entity Table
- Reset-Password UI screen is missing. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazor-wasm-boilerplate.