Now the question is how to access ActionItem.Items[0]
I've put a breakpoint to see the structure
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I tried to invoke get method in modal dialog that doesn't work.
I have implemented many-to-many, it's ok
I put the button in each line of the datalist
the method in controller it's ok.
<EditForm Model="@dev" OnValidSubmit="@OnValidSubmit">
<DataAnnotationsValidator />
<RadzenDataList Data="@dev?.ActionItems" TItem="ActionItem" PageSize="5" PagerHorizontalAlign="HorizontalAlign.Left" ShowPagingSummary="true">
<Template Context="dev">
<RadzenColumn Size="12" SizeMD="6" SizeLG="2">
<RadzenText TextStyle="TextStyle.H6" TagName="TagName.H5" Class="rz-mb-0">Close Date</RadzenText>
<RadzenText TextStyle="TextStyle.Body2">@(dev.CloseDate)</RadzenText>
</RadzenColumn>
<RadzenColumn Size="12" SizeLG="2" Class="rz-p-4">
<RadzenButton Icon="edit" ButtonStyle="ButtonStyle.Secondary" Size="ButtonSize.Small" Click="@(args => EditAction(dev.ActionItemId))" @onclick:stopPropagation="true" />
</RadzenColumn>
</Template>
</RadzenDataList>
</EditForm>
@code{
.....
[Parameter] public SuiviBE? dev { get; set; }
....
async Task EditAction(int actionId)
{
await client.GetAsync($"api/etude/{actionId}");
var test = await DialogService.OpenAsync("Editing action", de =>
@<div>
<div class="row">
<div class="col-md-4 align-items-center d-flex">
<h3 class="small text-muted">Open Date</h3>
</div>
<div class="col-md-6">
<RadzenDatePicker @bind-Value=@act.OpenDate Disabled=true />
</div>
<div class="col-md-4 align-items-center d-flex">
<h3 class="small text-muted">Close Date</h3>
</div>
<div class="col-md-6">
<RadzenDatePicker @bind-Value=@act.CloseDate Disabled=true/>
</div>
</div>
<br/>
<hr>
<br/>
<div class="row">
<div class="col">
<RadzenHtmlEditor @bind-Value=@act.DescriptionA style="height: 500px; weight : 200px; margin-bottom: 1rem;" UploadUrl="upload/image" />
<RadzenButton Text="Update" ButtonStyle="ButtonStyle.Light" Click=@SaveActionList />
@*<RadzenButton Text="Ok" Click="() => ds.Close(true)" Class="mr-1" Style="width: 80px;" />*@
<RadzenButton Text="Cancel" Click="() => de.Close(false)" ButtonStyle="ButtonStyle.Secondary" Class="mr-1" />
</div>
</div>
</div>
,new DialogOptions() { Width = "900px", Height = "812px", Resizable = true, Draggable = true });
async Task SaveActionList()
{
await client.PostAsJsonAsync($"api/etude/{act.ActionItemId}", act);
await OnSubmitCallback.InvokeAsync();
}
}
}
I've put a breakpoint to await client.GetAsync($"api/etude/{actionId}");
and I want e.g. edit the line 3002
You can see that the Id correspond to the good ActionItemId
Have you an idea how can I invoke the get method in this context?
Thanks in advance
Now the question is how to access ActionItem.Items[0]
I've put a breakpoint to see the structure