Issue with triggering jquery using HTMLsnippet

Hi all, I am trying to implement a function to a) first add an item to a listView and b) scroll the listView to the bottom. a) Adding the item to the list view is done via microflow triggered from a button (name = sendBtn) b Scrolling to a botton of the list view shall be done with jquery snippet, that is triggered by the button. Here is the current state of the implementation: I use the HMTLsnippet (enable JavaScript with jquery). I have double checked in the jquery docu: how to bind a function to a button using jquery ( how to scroll to the end of a container using jquery (   Then I have extracted the CSS class for the button and the list view from the DOM: Button: btn mx-button mx-name-btn1 btn-default ListView: mx-listview mx-listview-selectable mx-name-listView1 listview-stylingless   $(".mx-name-sendBtn").click(function(){ $(".mx-name-listView1").scrollTop(700) }); However, triggering the sendBtn does not lead to a scrolled down listView. Any suggestions would be great!
1 answers

Hi Tym,

Have you seen the javascript button? From the documentation “A Mendix button widget that can run custom JavaScript. You can even run a microflow before or after the JavaScript.” There is a setting to enable jquery, you could try using this instead of the html snippet to bind the script to your button.


Edit: You can try this for your hello world


To query an element I usually use classes since the IDs are dynamic. You can try hasClass