Code Monkey home page Code Monkey logo

Comments (3)

fgilde avatar fgilde commented on July 18, 2024

Depends on what you want to do.
Currently many things are possible but not documented, but also some things are maybe missing.
In general by using the meta configuration property or by registering meta configuration.

Check out sample.
https://github.com/fgilde/MudBlazor.Extensions/blob/main/SampleApplication/Pages/ObjectEditConfigured.razor

Also in the sample here you find how to use the IObjectEditMetaConfiguration Interface

https://github.com/fgilde/MudBlazor.Extensions/tree/main/SampleApplication/ObjectEditMetaConfig

And if you want to have specific types always rendered on a separate way Independently of model or type where it is used. You can use RenderDataDefaults
Like here

https://github.com/fgilde/MudBlazor.Extensions/blob/main/SampleApplication/ObjectEditMetaConfig/MySimpleTypeRegistrations.cs

The current snap documentation you will find here

https://github.com/fgilde/MudBlazor.Extensions/blob/main/MudBlazor.Extensions/Docs/ObjectEdit.md

from mudblazor.extensions.

franklupo avatar franklupo commented on July 18, 2024

https://github.com/fgilde/MudBlazor.Extensions/blob/main/SampleApplication/ObjectEditMetaConfig/DialogOptionsExMetaConfig.cs

The dialog edit list i want change default editor item es. password.

from mudblazor.extensions.

fgilde avatar fgilde commented on July 18, 2024

If you have for example a Model with FirstName, LastName and Password, you can configure meta for this model like this

public class UserModelMetaConfiguration: IObjectMetaConfiguration<UserModel>
{
    public Task ConfigureAsync(ObjectEditMeta<UserModel> meta)
    {
        meta.Properties(m => m.FirstName, m => m.LastName)
            .WrapInMudItem(mudItem => mudItem.xs = 6);
        meta.Property(m => m.Password)
            .RenderWith<MudTextField<string>, string>(field => field.Value, field =>
            {
                field.InputType = InputType.Password;
            })
            .WrapInMudItem(mudItem => mudItem.xs = 12);
        return Task.CompletedTask;
    }
} 

I created a small example for you. Hope this helps
mudExConfigSample.zip

This for example then looks like this
image

from mudblazor.extensions.

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.