GithubHelp home page GithubHelp logo

Comments (6)

gustavnavar avatar gustavnavar commented on July 20, 2024 1

I've published a new package version (5.0.10) with your code modification.
Thks.

from grid.blazor.

gustavnavar avatar gustavnavar commented on July 20, 2024

Could you send me the page where the grid is defined and the custom CRUD components?

from grid.blazor.

lpyedge avatar lpyedge commented on July 20, 2024

Thank you for your help.
Here is my code for your reference.

PaymentDestination.razor.cs

var client = new GridClient<Models.PaymentDestination>((q) => _masterDataService.GetGridRows(datas, columns, q), query, false,
     nameof(Models.PaymentDestination), columns, MasterDataRepository.LocaleCultureInfo)
     .Sortable()
     .Filterable()
     .SetStriped(true)
     .Selectable(true, true, false)
     .Crud(true, _masterDataService)
     .SetCreateComponent<PaymentDestinationCreateComponent>()
     //.SetUpdateComponent<PaymentDestinationUpdateComponent>()
     .SetHeaderCrudButtons(true);

PaymentDestinationCreateComponent.razor

@using GridBlazor
@using GridBlazor.Resources
@inherits GridCreateComponent<Models.PaymentDestination>

<h1>@Strings.Add 施行支払先</h1>
<EditForm Model="@Item" OnValidSubmit="@CreateItem">
    <DataAnnotationsValidator />
    <ValidationSummary />

    <div class="form-horizontal">
        <div class="form-group">
            <label for="FuneralCompanyId" class="control-label col-md-2">FuneralCompanyId: </label>
            <div class="col-md-5">
                <InputNumber id="FuneralCompanyId" class="form-control" readonly="readonly" @bind-Value="Item.FuneralCompanyId" />
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-5">
                <button type="submit" class="btn btn-primary btn-md">@Strings.Save</button>
                <button type="button" class="btn btn-primary btn-md" @onclick="BackButtonClicked">@Strings.Back</button>
            </div>
        </div>
    </div>
</EditForm>

from grid.blazor.

lpyedge avatar lpyedge commented on July 20, 2024

I'm so sorry, I debugged the code again and found that it was a problem with my code.
The entity class configured in the client and the entity class configured in the page component are two classes with the same name but different namespaces.
The issue has been solved!

from grid.blazor.

lpyedge avatar lpyedge commented on July 20, 2024

I'm encountering a problem when trying to reset the value of Item.FuneralCompanyId. Despite invoking StateHasChanged() after resetting the property on Item, the component doesn't reflect the new value. However, when I press the 'Save' button, the new value is rendered correctly. Is there a way to create a function to force the rendering?
Additionally, changing the access modifier of IJSRuntime jSRuntime from private to protected seems beneficial for usage within a custom CRUD component.

from grid.blazor.

lpyedge avatar lpyedge commented on July 20, 2024

I created a pull request (#411) to make the StateHasChanged() method effective in triggering component re-rendering.

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