Positioning Primefaces Dialog just below a Command Link
I am trying to use the below syntax to position my dialog just below my command link. But its not working and moreover, the dialog position is changing whenever I am scrolling the page up or down.Any help i开发者_如何学Cs appreciated.
<p:dialog context="'mainForm:commandLinkA','tl','br'" widgetVar="TreeDlg" header="Select " draggable="false">
Thanks and Regards, Renju
I managed to solve the problem using jquery. I am calling the following jquery function on clicking the command link and passing it the dialog id to be opened and the souce command link id.
function adjustPositionandOpenDialog(currentDialog,commandSource) {
$(currentDialog).dialog( 'open' );
var myDialogX = jQuery(commandSource).position().left+10;
var myDialogY = jQuery(commandSource).position().top - ( jQuery(document).scrollTop() + jQuery('.ui-dialog').outerHeight() )+142;
jQuery(currentDialog).dialog( 'option', 'position', [myDialogX, myDialogY] );
}
Thanks,
Renju
精彩评论