This is a migrated thread and some comments may be shown as answers.

Grid EDIT Popup Double Click Event Bug

2 Answers 314 Views
Grid
This is a migrated thread and some comments may be shown as answers.
NHJ
Top achievements
Rank 1
NHJ asked on 13 Dec 2019, 02:16 AM

This may not be a bug, but I think it's a bug.

I found something strange while using the edit popup.



{command: [{name: "edit", text: "edit"}], title: "feature", width: 100, filterable: false}

If you modify it using, no problem occurs.

 
dataBound: function (e) {
                var grid = this;

                grid.element.on ('dblclick', 'tbody tr', function (e) {
                    grid.editRow ($ (e.target) .closest ('tr'));
                })
            },

However, if you try to use the edit screen by using double-click instead of edit command, you now have a definite problem.

After opening the registration window once and canceling, double-clicking an existing item creates several windows.

What bug is this?

 

We will replace it with a YouTube link due to video size limitation.

https://youtu.be/FEl7LLfWD1w

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetomir
Telerik team
answered on 13 Dec 2019, 02:41 PM

Hi Nam,

The DataBound event handler is thrown every time a modification to the data has been done. Therefore, it would be triggered quite often and this might lead to the attachment of the same click handler multiple times - resulting in a faulty behavior. What I can recommend is that you attach the handler only once after the initialization of the grid. 

          $("#grid").getKendoGrid().one("dataBound", function(e){
            var grid = this;

            grid.element.on ('dblclick', 'tbody tr', function (e) {
              grid.editRow ($ (e.target) .closest ('tr'));
            })
          })

Check out the corresponding Dojo sample here:

https://dojo.telerik.com/OtICecuk

I hope you find this helpful.

 

Best regards,
Tsvetomir
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
NHJ
Top achievements
Rank 1
answered on 14 Dec 2019, 02:26 AM
You'll see it in the next task, but that's probably going to be solved. Thank you very much!
Tags
Grid
Asked by
NHJ
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
NHJ
Top achievements
Rank 1
Share this question
or