javascript - Powertip Link to open Sharepoint 2013 Modal Dialog -
i created link loads powertip tooltip link in it, have jquery function looks class of link , opens content in modal dialog in sharepoint. works links in page, not work link in tooltip.
how can fix this?
this code powertip tooltip.
$(function() { var mouseondiv = $('.linkclass'); var tipcontent = $('<a href="#" class="modal-link">text</a>' ); mouseondiv.data('powertipjq', tipcontent); mouseondiv.powertip({ placement: 's', mouseontopopup: true }); });
here code modal dialog load.
$(document).ready(function() { $("a.modal-link").on("click", function(e){ var destination = $(this).attr("href"); if(destination.indexof("?") > -1) { destination += "&isdlg=1"; } else { destination += "?isdlg=1"; } var title = $(this).text(); var dialog = sp.ui.modaldialog.showmodaldialog({ title: title, url: destination, autosize: true, width: 1024, height: 800 }); e.preventdefault(); }); });
Comments
Post a Comment