- Home
- Forum
- Angular - EJ 2
- Is there a way to know which column is being edited?
Is there a way to know which column is being edited?
In my grid, I have a few columns that have translations. When the grid is in read mode, the value is being shown in the current language. But I want the user to be able to change other languages as well.
My idea is to open a dialog when the user begins editing one of those columns. Is it possible to know which column is being edit, while the row is in edit mode?
Hi Niels Van Goethem,
Greetings from Syncfusion support.
Upon reviewing your query, we have identified that you require the column name from the edited row to adjust the language on the Grid accordingly. To provide a more effective solution, we need additional information. Kindly share the following details:
1. Specify the mode of editing employed in your Grid.
2. Indicate the type of data binding used in the Grid—whether it is remote or local. If remote data is utilized, please provide the adaptor details.
3. Provide the complete Grid rendering code along with any event handler functions.
4. Mention the Syncfusion package version currently in use.
Regards
Aishwarya R
Dear Aishwarya, it is incorrect that I want the column name to adjust the language in the grid. What I am trying to achieve, is that I use inline editing in the grid. Some columns, for fields like "name", "description", etc, different values for differen languages exist. To make these translations easily accessible for editing, I came up with the idea of using a dialog for that (either custom or provided by the grid component). Is it possible to either:
- Know which column is being edited, so in the "actionBegin" event, I can open a dialog or not
- Or if there is another way to handle this situation within the grid component
Hi Niels Van Goethem,
Sorry for the inconvenience caused.
Query1: “Know which column is being edited, so in the "actionBegin" event, I can open a dialog or not”
To address your requirement for triggering a dialog based on a column name during the Grid's actionBegin event, we have developed a similar sample based on the shared code example. In this sample, the column name is retrieved from the recordClick event of the Grid and utilized to initiate the dialog in the actionBegin event. Please refer to the sample and code example provided below for more details.
|
App.component.ts actionBegin(args: any) :void { if (args.requestType === 'beginEdit' && this.columnName === "Employees") { this.nameDialogVisible = true; } } recordClick(args: any) :void { this.columnName = args.column.field; } |
Sample: Vu8unu (forked) - StackBlitz
Query 2: “Or if there is another way to handle this situation within the grid component”.
Query 3: “Or maybe it is easier to edit the translations in the details panel, instead of a custom dialog”
To offer an enhanced solution for the above queries, we require additional information to accurately understand your requirements and provide an optimal solution.
- You mentioned that you are using columns with translations in the Grid, which change values based on different languages. Kindly provide details on how you manage this language switching and how the Grid values are updated accordingly.
- Kindly share a simple video demonstration of your use case.
- Please explain, in the case of editing, how you are trying to make the language change accessible using the dialog.
- If possible, please try to implement the same with the shared sample and explain your exact requirement.
Regards
Aishwarya R
- 3 Replies
- 2 Participants
- Marked answer
-
NV Niels Van Goethem
- Aug 5, 2024 08:21 AM UTC
- Aug 7, 2024 01:15 PM UTC