Open sven5 opened 5 years ago
It would be great if you could implement this change in your automatic code generation tool because doing it manually is very time-consuming.
But for the moment, as you are very busy, there is no other way for me to do it manually.
Thanks Sven
Hi Miha,
I was successful in setting a widget's value back to Blazor. It would be great to have this functionality for all widgets. Currently I manually implemented some changes for this to work. You have to take care of this in your automatic code generation.
Let me try to explain with some sample code. I started with a
DxSelectBox
<DxSelectBox DataSource="@(NewsService.GetCategories())" DisplayExpr="@("Name")" ValueExpr="@("Id")" bind-Value="@DataItem.CategoryId" OnValueChangedEnabled="true" />
In Registration.js I had to extend the code for
BlazorDevExtreme_DxSelectBox_Init
to call theonValueChanged
function:In Controls.cs I had to change the ValueChanged EventHandler to use a Tuple:
public static event EventHandler<(JQueryEventArgs, string)> ValueChanged;
And the modified JS registration:
Now in the component DxSelectBox.cshtml I had to modify the event handler:
Please see my checkin for a complete overview.