我有一个功能齐全的 PrimeNG Dialog 正在运行。我正在使用 向其传递数据,DynamicDialogService.open但是我们如何将数据发送回父级?
发回数据没有出现在我可以看到的文档中。
this.dialogService.open(SomeModalComponent, {
...
data: {
someData: 'some string'
},
}
Run Code Online (Sandbox Code Playgroud)
在对话框中我们使用数据
ngOnInit(): void {
console.log(this.config?.data?.someData); // 'some string'
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试在本机反应中创建一个模态,以便当我单击传输按钮时,它会提示输入用户密码来完成交易。我面临的挑战是,它没有按预期工作。
屏幕看起来是这样的:
通过单击传输按钮触发模式后,模式将覆盖整个屏幕,如下所示
老实说,我不知道从什么开始、从哪里开始。
我的代码看起来是这样的:
import {
ImageBackground,
Modal,
ScrollView,
StyleSheet,
Text,
TextInput,
TouchableOpacity,
View,
} from 'react-native';
import {Picker} from '@react-native-picker/picker';
import React, { useState } from 'react';
import { useNavigation } from '@react-navigation/native';
const LocalPayments = () => {
const navigation = useNavigation();
const [modalVisible, setModalVisible] = useState(false);
return (
<View style={styles.container}>
<View style={styles.space} />
<ScrollView
contentContainerStyle={{
justifyContent: 'space-between',
alignItems: 'center',
}}>
<ImageBackground
source={{
uri: 'asset:/logo/bg.JPG',
}}
imageStyle={{borderRadius: 6}}
style={{
top: -30,
paddingTop: 95,
alignSelf: 'center',
width: 328, …Run Code Online (Sandbox Code Playgroud) 我有一个模态对话框显示主应用程序窗口设置为所有者(如dialog.ShowDialog(mainAppWindow)),我想暂时允许用户与主应用程序窗口交互,然后再次返回到模式对话框.
我怎样才能做到这一点?我正在使用Windows窗体.
编辑: AutoCAD做得很好.
我有这个C#代码:
public partial class Continue : Form
{
public Continue(string colourName)
{
InitializeComponent();
lblMessage.Text = String.Format("Do you wish to change the colour to {0}", colourName);
}
private void btnConfirm_Click(object sender, EventArgs e)
{
btnConfirm.DialogResult = DialogResult.OK;
}
private void btnCancel_Click(object sender, EventArgs e)
{
btnCancel.DialogResult = DialogResult.Cancel;
}
}
Run Code Online (Sandbox Code Playgroud)
它运行正常,但是当弹出对话框时,它需要我点击两次按钮才能使用它.有谁知道为什么?
我需要杀死jQuery UI模式对话框顶部的关闭'x'按钮.我有一个模式,打开一个OK按钮,重定向到该网站.模态背后的网站位于iframe中.当用户同意对话框中的语句并单击"确定"按钮时,它将重定向到iframe外部的站点.如果用户点击"x",则会转到iframe网站,我不希望这样做.
我需要模态作为单向进入它所使用的网站.它基本上迫使用户接受用户协议.
我会发布代码,但它是一个内部网站点.
谢谢大家的帮助!
编辑:此站点是政府内部网门户,而不是商业站点.因此,目标不是将用户陷入网站,而是让用户知道此网站的使用受到限制,并确保您理解并接受用户协议,或者您无法使用该网站.
这个问题可能有一个非常简单的解决方案,但我只是看不到它!
我有一个包含项目列表的页面.每个项目都有相同的jquery ui按钮(在对话框中并将该项目添加到列表中).我通过持有DB id的父母DIV识别该项目.到现在为止还挺好...
问题只是列表中的第一个按钮有效!第二个,第三个等按钮根本不显示任何反应.这些按钮都具有相同的ID - 因为列表是动态的,每次点击都会触发相同的操作.只有父母身份证更改.
下面是显示部分:
<div id="2">
<div id="56">
<button id="add-audio-file" class="ui-button ui-state-default ui-corner-all">betty_2.mp3</button>
</div>
</div>
<div id="2">
<div id="57">
<button id="add-audio-file" class="ui-button ui-state-default ui-corner-all">betty_3.mp3</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这里是js部分:
$('#add-audio-file').click(function() {
assetID = $(this).parent('div').attr('id');
pageID = $(this).parent('div').parent('div').attr('id');
$.post(
"modules/portfolio/serialize.php",
{id : pageID, assetid : assetID, do : "add-audio-file"},
function(data, textStatus, xhr) {
$('#dialog-add-audio').dialog('close');
}
);
});
Run Code Online (Sandbox Code Playgroud)
我正在使用jquery 1.4.2和jquery ui 1.8rc3任何想法?
当形式A是模态的并且它显示第二个模态形式B,并且B的模态结果被设置而B然后关闭时,A也被关闭.
如何防止这种情况?
我在我的facebox模式上使用我的自定义关闭按钮来关闭它...它工作正常(即)它关闭但它在我点击关闭按钮后附加到页面的底部...
<a onclick="$.facebox.close();" href="javascript:void(0);" class="close">
<img alt="Close the popup" src="images/close.png" title="close"
class="close_image" />
</a>
Run Code Online (Sandbox Code Playgroud)
这是我得到的,
alt text http://img825.imageshack.us/img825/3739/foo.jpg
这是我想要做的,
$(document).bind('close.facebox', function() {
$(document).unbind('keydown.facebox')
$('#aspnetForm').append($('#facebox .content').html());
/// extra line to make sure there's no flashing effect as the facebox closes: the content is still in there too!
$('#facebox .content').children().css({ 'display': 'block' });
$('#facebox').fadeOut(function() {
$('#facebox .content').removeClass().addClass('content')
hideOverlay()
$('#facebox .loading').remove()
})
})
Run Code Online (Sandbox Code Playgroud)
我的页面有这个,
$(document).ready(function($) {
$.facebox.settings.opacity = 0.2;
$('a[rel*=facebox]').facebox();
});
<div id="forgetPassword" style="display:none">
//content
</div>
Run Code Online (Sandbox Code Playgroud) 我有一个电子邮件按钮,点击后,会弹出一个模态jQuery UI对话框,显示一个用于通过电子邮件发送给自己的按钮.我的代码在这里:
<input type="button" value="Email to me" onClick="$("#emailModal").dialog({title:'Email It Along',height:300,width:350,modal:true,resizable:false});"/>
Run Code Online (Sandbox Code Playgroud)
这是#emailModal:
<div id="emailModal">
<p><input type="button" value="Email to me" onClick="$('#emailPost').submit()" id="emailJQButton"/></p>
</div>
Run Code Online (Sandbox Code Playgroud)
但是,当我单击按钮时,没有任何反应,并且没有弹出对话框.我查看了所有代码,但找不到问题.有帮助吗?
编辑: 发现问题,但我还有一个问题:
if($_SESSION["loggedIn"] == 1)
{
echo "<form action='php/emailPost.php' method='POST' class='inline' id='emailPost'>";
echo "<input type='hidden' value='" . $_SESSION["email"] . "' name='emailAddress'>";
echo "<input type='button' value='Email To Me' onClick='$(\"#emailPost\").submit();$(\"#emailModal\").dialog('close');'/>";
echo "<input type='hidden' name='passedCoupID' value='" . $coupID . "'/>";
echo "</form>";
echo "<h3>Or</h3>";
echo "<form action='php/emailPost.php' method='POST' class='inline' id='emailPost2'>";
echo "<input type='text' value='Enter an Email' name='emailAddress' style='display: inline-block;'>"; …Run Code Online (Sandbox Code Playgroud) 这里的代码是从RootViewController启动的模态视图,用于在电影下方显示带缩略图幻灯片的视频,然后显示绑定到电影的定时指令.
这一切都有效,但有一个内存泄漏/缺乏发布,我看不出去寻找并花了三天时间试图解决它,现在是时候寻求帮助了......
如果我通过注释来禁用NSNotificationCenter(在.m中突出显示)我没有任何关于内存的问题并保留定时文本.但我也没有任何缩略图.我试过插入[[NSNotificationCenter alloc] removeObserver:self]; 在众多的地方,看看是否会为我摆脱它.但是,唉,无济于事.
我也试过发布'backgroundTimer'但是当我尝试编译和运行时它并没有给我留下太深刻的印象.
本质上,我第一次加载模态视图,没有任何问题,一切似乎都很好 - 但是,如果我用 - (IBAction)关闭它:(id)sender; 似乎有些事情没有发布,因为下次我启动相同的页面时内存使用量增加了大约30%(大致是缩略图生成使用的量),并且每次重新启动时增加的量大致相同模态视图.
请记住,我是一个新手,这个错误可能是一个血腥的愚蠢的你知道的人.但是为了完成这个项目,我很乐意接受你想要的任何虐待.
另外,这是我明天的生日,如果我可以对它进行排序,那将是(相当可悲)最好的礼物!
这是代码........
.H
#import <UIKit/UIKit.h>
#import <MediaPlayer/MPMoviePlayerController.h>
#import "ImageViewWithTime.h"
#import "CommentView.h"
@interface SirloinVideoViewController_iPad : UIViewController {
UIView *landscapeView;
UIView *viewForMovie;
MPMoviePlayerController *player;
UILabel *onScreenDisplayLabel;
UIScrollView *myScrollView;
NSMutableArray *keyframeTimes;
NSArray *shoutOutTexts;
NSArray *shoutOutTimes;
NSTimer *backgroundTimer;
UIView *instructions;
}
-(IBAction)close:(id)sender;
-(IBAction)textInstructions:(id)sender;
@property (nonatomic, retain) IBOutlet UIView *instructions;
@property (nonatomic, retain) NSTimer *theTimer;
@property (nonatomic, retain) NSTimer *backgroundTimer;
@property (nonatomic, retain) IBOutlet UIView *viewForMovie;
@property (nonatomic, retain) MPMoviePlayerController *player; …Run Code Online (Sandbox Code Playgroud)