Duplicate Problem in Inline edit Fields When Multiple Lines are Added

1 Answer 62 Views
Editor Grid
Mohammed
Top achievements
Rank 1
Mohammed asked on 14 Jun 2023, 05:36 PM
www.telerik.com
In inLine Edit Field when Adding new Line or create multiple lines with the add new button the input field is duplicating when editing one field. ie, You can now type on the different input and observe duplicates
But i needEvery single inputs here needs to be unique.

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 16 Jun 2023, 08:20 AM

Hi Mohammed,

The issue that you are describing is due to the fact that the changes in the items are applied based on their ID field and since the new items in the demo in question do not have unique ID, adding multiple items will result in having multiple items with the same ID (null) and the onItemChange event will update all of those items. In order to avoid this behavior you need to assign unique ID to the newly added items.

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.
Mohammed
Top achievements
Rank 1
commented on 16 Jun 2023, 11:54 AM

Is there any other alternative ideas for resolving this issue other than you provide?

Konstantin Dikov
Telerik team
commented on 16 Jun 2023, 07:06 PM

Hi Mohammed,

Another option would be to disable the toolbar if there is active editing within the Grid. I have prepared an example demonstrating how to disable the header of the Grid:

As you will notice, a "disabled" class name is added to the toolbar and the header with the filters if there is active editing:

            <style>
            .disabled{
                pointer-events: none;
            }

Mohammed
Top achievements
Rank 1
commented on 19 Jun 2023, 05:43 AM

But this is not using Kendo, Right? How it used by kendo and Also in this case i couldn't have access to use Multiple lines, But I need Access for my requirement. So Is there similar Code or Solution for that?
Konstantin Dikov
Telerik team
commented on 20 Jun 2023, 06:42 PM

Hi Mohammed,

The example that I have shared still uses KendoReact Grid, but with some customization for disabling the editing/add new when an item is in edit mode. If you save the item you will still be able to add another one or edit different items after the previously opened item is updated.

If you want to have multiple items opened for editing at the same time, please ensure that you are adding an unique ID for each new item that you are adding to the Grid, so that they can be identified while editing/updating. Without an unique ID (dataKey field) it will be impossible to update the correct item.

Hope this helps.

Tags
Editor Grid
Asked by
Mohammed
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or