Are you sure that itemData.url actually contains a url? Since you say that the button collapses for all items, it seems from your code that either itemData.url is empty for all items, or you are using the wrong item field.
As you stated in your original post " The link comes from a “link” column in the dB." Maybe the field you want is link ?