Guest User

Untitled

a guest
Oct 15th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  2.  
  3. <script type="text/javascript">
  4.  
  5. $(document).ready(function(){
  6. //In SharePoint OOTB list view, all 'td' will have this class 'ms-cellstyle'
  7. $("td.ms-cellstyle a").click(function () {
  8. var currentURL = $(this).attr('href');
  9. var onclickVal = $(this).attr('onclick') || '';
  10. if(onclickVal == '') {
  11. currentURL = "javascript:ModalDailog('"+currentURL+"')";
  12. $(this).attr('onclick', 'empty');
  13. $(this).attr('href', currentURL);
  14. }
  15. });
  16. });
  17.  
  18. //Function to open url in Modal Dailog
  19. function ModalDailog(urlvalue) {
  20. var options = {
  21. url: urlvalue,
  22. allowMaximize: true,
  23. showClose: true,
  24. dialogReturnValueCallback: silentCallback
  25. };
  26. SP.UI.ModalDialog.showModalDialog(options).autoSize();
  27. }
  28. function silentCallback(dialogResult, returnValue) {
  29. }
  30. function refreshCallback(dialogResult, returnValue) {
  31. SP.UI.Notify.addNotification('Operation Successful!');
  32. SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
  33.  
  34. }
  35. </script>
Add Comment
Please, Sign In to add comment