The on () event in the on () event is always incremented.

There is another one in the

.on event. How to solve the problem is always incremented one by one when you click

.
    tree.on("nodeselect", function (e) {
        if (e.isLeaf) {
            var id = e.node.id;
            grid.load({id:id});
            var latLng = new google.maps.LatLng(e.node.lat,e.node.lng);
            tree.on("nodeclick", markerClickText(id,latLng));
 
            var div =map.getDiv();
            map.setZoom(5);//
            map.panTo(latLng);
            map.panBy(0, -(div.offsetHeight/4));//
            
        } else {
            grid.setData([]);
            grid.setTotalCount(0);
        }
    });

clipboard.png

Feb.28,2021

removed the event before adding

https://codeshelper.com/q/10.

tree.un ('nodeclick'). On ("nodeclick", markerClickText (id,latLng));

$('-sharpsub').unbind('click').click(function () {
    ...
});

$('-sharpsub').off().click(function () {
...
});

The

/ / binding event must not be put into the event, ah, if you put it in the event, you only need to remove

first.
tree.on("nodeselect", function(e){

}).on("nodeclick", function(e){

});

1. One way is to use a delegate and hang the time on the parent element
2. Second, off before on

Menu