Hi!
In DXDataGrid I want to be able to:
1 Cancel row deletion
2. Add default value to cells in a newly added row
3. Reject changes in edited row before row being updated.
For some events as selectionChanged, cellClick, keyDown there are a ton of data in e object.
For events like
“rowUpdating”,
“rowUpdated”,
“rowValidating”,
“saved”,
“saving”,
“rowPrepared”,
“rowInserted”,
“rowInserting”,
“rowRemoving”,
“rowRemoved”,
There is nothing for e.data. I in this events need to receive row key/index in order to be able to manipulate row content and reject row editing, row deletion, eventually row adding when it may be necessary.
How to manage that?
In your integration project I added:
case “rowUpdating”:
return {
rowIndex: args.rowIndex,
currentSelectedRowKeys: args.currentSelectedRowKeys,
selectedRowKeys: args.selectedRowKeys
};
case “saving”:
return {
rowIndex: args.rowIndex,
currentSelectedRowKeys: args.currentSelectedRowKeys,
selectedRowKeys: args.selectedRowKeys
};
case “rowRemoving”:
return {
rowIndex: args.rowIndex,
currentSelectedRowKeys: args.currentSelectedRowKeys,
selectedRowKeys: args.selectedRowKeys
};
But e.data object is still empty.
Thank you!
You can’t process synchronous events on the server and the data object has to be populated in javascript.
You can handle the event on the client easily by adding a WidgetEvent. If you want to wire it back to the server use the promise as shown in the devexpress documentation: https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/#onRowRemoving
I have attached a sample that shows:
In general, Wisej widgets are all tightly integrated with server functionality. All third party widgets are not designed to interact with the sever and you are supposed to write your code in javascript, or fire off api calls which need an endpoint, a session, etc. With the wisej wrapper most of the work is already there but you still need to wire the api postback if the widget expects a response. Otherwise a normal event works.
Additionally, all third party widgets do not support receiving calls from the server. The wisej wrapper also adds this feature automatically. The other alternative to simply write parts and pieces of your app in javascript, as required by angular and blazor.
Download the latest devextreme extension from Github to use the sample and dxBase.Culture.
Please login first to submit.