I'm using TOC/Legend widget as a default legend panel in my ArcGIS based JavaScript API web app.
It works great, beside now i want to filter this legend panel based on users current map extent.
The reason is, currently i have some 30 to 40 items in this TOC pane and it will better to filter them out based on the location user is focusing on. So, if any extension or widget someone already using or modifying the existing TOC will help.
There is already an ArcScript present for ArcGIS Desktop called Legend Limiter, but that is not for JavaScript API. Also a similar question is asked as Showing only legend items that are actually displayed on map in ArcGIS Desktop? but again, that doesn't address the JavaScript API issue.