I am working with igniteUI 13.1 and rendering a grid in a SPA (single page app). The grid is rendering perfectly and works well with all features that I have tested to this point with the exception of SOrting. I can click on the column header and get the grid to sort properly as long as I don't click on the actual header text. If I click on the actual header text, it routes me back to the start page of the App. I tracked this down in the rendered HTML code to an Anchor tag that surrounds the headertext. Such as <a href='#'> <span class=ui-iggrid-headertext" style="width: 100%;" > First Name <span></a>
If I click on the words First Name it routes back to the home page, If I click on the blank space in the header after those words, it sorts properly.
Is there a way to get around this issue?
Tried that, but it did not work. I did find a good solution however:
It was to remove the entire HREF attribute from the <A> tag when it contained just "#".
This bit of Jquery did the trick:
$(document).on("click", ".view a[href^=\'#\']", function (e) {
$(this).removeAttr("href");
});
Hello smaple2dt,
Thank you for contacting Infragistics!
It is possible to override the default behavior when the column header is clicked by calling e.preventDefault(). Overriding the default behavior may prevent the application from being routed back to Home page.
Please let me know if the behavior persists or otherwise.
If you have any questions, please let me know as well.