title: SharePoint 2013, opening another sharepoint list item in modal dialog fails once you sort the list
body: <p>Sorry for the long post. This has been killing me. I had this script working perfectly fine in SharePoint 2010 (online) and basically i have a source custom list (list A) with a hyperlink column and a Destination List with say title and my name.</p>
  
  <p>Source List (list A) looks like this with these 2 columns</p>
  
  <p>Title    Test Link</p>
  
  <p>A         Link 1</p>
  
  <p>B         Link 2 </p>
  
  <p>C         Link 3</p>
  
  <p>Each of these links link to the actual list item in the destination list, so for example, link 1 is/sites/2013DevSite/Lists/Destination%20List/EditForm.aspx?ID=1</p>
  
  <p>So basically i want anytime the Link are clicked that point to another list's item to open in a modal dialog and the script below worked perfectly fine in SharePoint 2010 (online)</p>
  
  <pre><code>&lt;script language="javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script language ="javascript" type="text/javascript"&gt;   
  
  jQuery(document).ready(function() {
  jQuery('a[href*="EditForm.aspx"]').each(function (i, e) {
  // Store the A tag's current href in a variable
  var currentHref = jQuery(e).attr('href');
  jQuery(e).attr({
  'href': 'javascript:void(0);', 
  // Use the stored href as argument for the ShowInModal functions parameter.
  'onclick': 'ShowInModal("' + currentHref + '");'
  
  });
  });
  
  }); 
  
  function ShowInModal(href) {
  SP.UI.ModalDialog.showModalDialog({title: "Edit Item", url: href});    
  };
  &lt;/script&gt;
  </code></pre>
  
  <p>All it does is find the href tags for that particular value Editform.aspx and the pop modal works in SP 2010 online. So the site page is designed in such a way there is a content editor web part with the reference to this javascript file and the sharepoint list is right beneath it and this worked perfectly opening in modal windows in SP 2010.</p>
  
  <p>Since migration to 2013, this is what exactly happens</p>
  
  <p>1.) when you come to the site page, the modal works,</p>
  
  <p>2.) If you filter or sort on say the Title or Test Link column in Source list (lets say you select the Value A), the script does not fire at all, if i hover over the hyperlink, the who hyperlink is shown and does not open the hyperlink in the modal pop up. - This is important because i want to be able to sort on a particular item...</p>
  
  <p>Could someone please let me know what am i doing wrong and thanks for all the help.</p>
  
  <p>Once again i am trying to open a sharepoint list item from another list using Jquery</p>