모달 RadWindow가 열리 며 사용자가 조치를 취한 다음 저장을 클릭하면 모달 창이 닫히고 기본 그리드 새로 고침모달 RadWindow가 Chrome에서 닫히지 않음
IE와 Firefox 모두에서 제대로 작동하지만 Chrome은 모든 "작업"을 수행하지만 모달 페이지는 계속 열려 있습니다. 저장 버튼을 클릭 한 경우에만 해당됩니다. 취소 단추와 양식 상단의 닫기 단추가 여전히 올바르게 작동합니다.
이 자식 창에서 자바 스크립트입니다 :
<script type="text/javascript">
function refreshGrid(arg) {
if (!arg) {
$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("Rebind");
}
else {
$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindAndNavigate");
}
}
</script>
부모를 실행하여 모달 창을로드 :
<script type="text/javascript">
function GetRadWindow() {
var oWindow = null;
if (window.radWindow)
oWindow = window.radWindow;
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
return oWindow;
}
function CloseRadWindow() {
var oWnd = GetRadWindow()
oWnd.SetUrl("");
oWnd.close();
}
function CloseAndRebind(args) {
var oWnd = GetRadWindow()
oWnd.BrowserWindow.refreshGrid(args);
oWnd.SetUrl("");
oWnd.close();
}
</script>
이 부모의 refreshgrid 기능입니다
protected void btnSplitInvoice_Click(object sender, EventArgs e)
{
var btn = sender as Button;
var item = (GridDataItem)btn.Parent.Parent;
long id = long.Parse(item["Id"].Text);
var itemType = this.TabStrip1.SelectedIndex == 0 ? "TransferOrderInvoice" : "EquipmentInvoice";
string scriptstring = "var oWindow=radopen('../Misc/SplitInvoice.aspx?id=" + id + "&type=" + itemType + "','SplitInvoice');oWindow.SetModal(true);";
ScriptManager.RegisterStartupScript(this, this.GetType(), "openwindow", scriptstring, true);
}
자식의 저장 버튼은 코드에서 많은 작업을 수행 한 다음이 코드로 끝납니다. :
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "mykey", "CloseAndRebind('navigateToInserted');", true);
는 취소 버튼이로 설정 : 내가 잠시 다시 가까이 window.open('', '_self', '');
를 추가하는 것을 제안에서 하나 개의 항목을 찾았지만, 그 보이지 않았다
<button type="button" class="CancelBtn" value="" onclick="CloseRadWindow()">
</button>
적용 (또한 didn를 내가 그것의 지옥을 위해 그것을 시험했을 때 일하지 마라).
편집이 :
Cannot call method 'ajaxRequest' of null
을하지만 확실하지 않은 즉, 원인을 무엇 경우 : 콘솔 개방과 크롬을 실행할 때, 나는 refreshgrid
가 실행 중일 때 내가 메인 페이지에 오류가납니다 것을 볼 수 있습니까 문제 여부. 그것으로 지금 보는 것.
EDIT2 : Chrome을 사용할 때 위의 null 오류의 원인 인 refreshGrid
이 실행될 때까지 마스터 페이지의 RadAjaxManager가 발견되지 않는 것 같습니다. 나는 refreshGrid 함수의 용기를 document.location.reload();
으로 대체하여 문제를 "고칠 수 있었다". 내가 그것을 도울 수 있다면 나는 전체 페이지를 다시로드하지 않을 것이다. 그래도 이것을 고치는 방법이 있는지 궁금해한다. 그리고 나는 IE와 Firefox가 Chrome을 사용하지 않을 때 왜 이것을 처리하는지 궁금해합니다.
상세 정보 : 메인 페이지의 Page_Load 이벤트 :
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.Session["AllUserLocationValue"] = string.Empty;
this.InitializeThePage();
}
RadAjaxManager manager = RadAjaxManager.GetCurrent(this.Page);
manager.AjaxRequest += this.manager_AjaxRequest;
manager.AjaxSettings.AddAjaxSetting(manager, this.pnlHeading, this.RadAjaxLoadingPanel1);
manager.AjaxSettings.AddAjaxSetting(manager, this.RadCodeBlock1, this.RadAjaxLoadingPanel1);
}
의견을 보내 주셔서 감사합니다 :'SetUrl ("")'; 이 경우 문제에 영향을 미치지는 않았지만 귀하의 설명에 따라 사용하지 않는 것의 가치를 알 수 있습니다. 문제는 refreshGrid에서 $ 찾기가 마스터 페이지의 RadAjaxManager의 ClientId를 찾을 수 없다는 것입니다. –
이상합니다. 이 참조를 반환하는 별도의 함수를 만들어 스크립트 태그가 부분적인 포스트 백에 포함되어 있지 않은지 확인하십시오. 또는 관리자의 CLIentID를 보유 할 글로벌 JS 변수를 사용하여 필요한 ID를 얻기 위해 쉽게 디버깅 할 수 있습니다. 간단한 __doPostBack() 또는 숨겨진 버튼을 사용하여 언제든지 클릭() 할 수도 있습니다. – rdmptn