Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82030

User select row versus API select

$
0
0

Hi,
I've been looking for quite a while on the site, and I can't seem to find a way to tell the source of a select event. i.e. what triggered the event, a user click or an API call. The event objects seem to be identical.

Here's my situation - I'm syncronizing a leaflet map, with a datatable, each row in the datatable is a location on the map. I need to know if the user clicked on the table so that I can trigger the 'active' mode on the item in the map. This works fine by itself, I attach to the table.on('select', event, and send the map a message to update it's location.

BUT when I click on the map, I need to tell the table to select the corresponding row. Fine, I issue a table.row(id).select() API call, but that triggers the event - which updates the table, which you know the rest.

Sure - I can put some additional record-keeping in and probably get around this, but it seems really kludgy - I should be able to find the source of the event, and if it's undefined (in the case of an API call) I don't propegate further.

Any ideas? I can offer a patch to update this in the codebase if it doesn't exist.

Thank you!


Viewing all articles
Browse latest Browse all 82030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>