You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/06/27 02:43:58 UTC

[GitHub] [echarts] loadingwyn opened a new issue, #17284: [Feature] filter dispatched events in event listener

loadingwyn opened a new issue, #17284:
URL: https://github.com/apache/echarts/issues/17284

   ### What problem does this feature solve?
   
   When I dispatch an 'datazoom' event manually, my 'datazoom' listener can know it is from code instead of user operations
   
   ### What does the proposed API look like?
   
   myChart.dispatchAction({
       type: 'dataZoom',
       **emitEvent: false,**
       start: 20,
       end: 30
   });


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] loadingwyn closed issue #17284: [Feature] filter dispatched events in event listener

Posted by GitBox <gi...@apache.org>.
loadingwyn closed issue #17284: [Feature] filter dispatched events in event listener
URL: https://github.com/apache/echarts/issues/17284


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] loadingwyn commented on issue #17284: [Feature] filter dispatched events in event listener

Posted by GitBox <gi...@apache.org>.
loadingwyn commented on issue #17284:
URL: https://github.com/apache/echarts/issues/17284#issuecomment-1168818608

   @plainheart  thanks, but it would be better if you can show this use case in documents


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart commented on issue #17284: [Feature] filter dispatched events in event listener

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #17284:
URL: https://github.com/apache/echarts/issues/17284#issuecomment-1166785002

   Currently, you can put an extra parameter as a flag into the action payload and check it in the event handler. For example,
   
   ```js
   chart.on('datazoom', e => {
     if (e.emitEvent) {
       // do something
     }
   })
   ```
   
   ```js
   chart.dispatchAction('datazoom', {
     type: 'dataZoom',
     emitEvent: false,
     start: 20,
     end: 30
   })
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org