Open sven5 opened 5 years ago
Update:
I want to attach the OnInitialized event of the datagrid to call some JS to be able to attach an Web API AspNet data store.
I was successful in adding some init code in the BlazorDevExtreme_DxDataGrid_Init
Please see my workaround in Registration.js.
Now I'm able to attach to the ComponentInterop.Initialized
event, see here:
protected override void OnInit()
{
DevExpress.ComponentInterop.Initialized += OnInitialized;
base.OnInit();
}
void OnInitialized(object sender, JQueryEventArgs e)
{
// it's impossible to add an id attribute to the Dxdatagrid component.
if (e.Identifier?.StartsWith("DxDataGrid") == true)
{
[…]
}
}
I think you should either call base widget functionality (Widget, Component, GridBase etc.) in any master widget component or implement some logic for inheritance.
I attached to the onContentReady
event to set the grid's datasource by JavaScript. the onInititalized
event is not suitable because the grid is not ready yet.
Update: I have successfully bound the grid to a Web API backend with the help of DevExtreme AspNet library. All CRUD operations are working against my EF Core data layer.
Hi Miha,
I'm currently trying to attach to the event Datagrid.OnInitialized. Though I set OnInitializedEnabled to true the event is not being called. While searching through registration.js I found out that the function
BlazorDevExtreme_Component_Init
is not being called. OnlyBlazorDevExtreme_DxDataGrid_Init
is called. But the event lives inBlazorDevExtreme_Component_Init
Could you please look into it?As a thank you, I will provide a new datagrid demo bound to Web API backend. :smile:
Regards Sven