Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- //In SharePoint OOTB list view, all 'td' will have this class 'ms-cellstyle'
- $("td.ms-cellstyle a").click(function () {
- var currentURL = $(this).attr('href');
- var onclickVal = $(this).attr('onclick') || '';
- if(onclickVal == '') {
- currentURL = "javascript:ModalDailog('"+currentURL+"')";
- $(this).attr('onclick', 'empty');
- $(this).attr('href', currentURL);
- }
- });
- });
- //Function to open url in Modal Dailog
- function ModalDailog(urlvalue) {
- var options = {
- url: urlvalue,
- allowMaximize: true,
- showClose: true,
- dialogReturnValueCallback: silentCallback
- };
- SP.UI.ModalDialog.showModalDialog(options).autoSize();
- }
- function silentCallback(dialogResult, returnValue) {
- }
- function refreshCallback(dialogResult, returnValue) {
- SP.UI.Notify.addNotification('Operation Successful!');
- SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
- }
- </script>
Add Comment
Please, Sign In to add comment