2014-02-18 195 views
0

我正在使用jquery mobile並使用simpledialog2創建對話框。Simpledialog2未捕獲TypeError:無法讀取未定義的屬性'sdIntContent'

我的代碼

<li><a href="#" data-rel="dialog" onclick="return openpopup();" style="font-weight:normal;">Register</a></li> 



function openpopup() { 
    $('#mobile-login-panel').simpledialog2({ 
     autoOpen: false, 
    resizable: true, 
    height: 'auto', 
    headerText: 'Sign in', 
    headerClose: true, 
    width:'auto', 
    headerClose: true, 
     blankContent:"SomeHtml" 


    }); 
    $("div.ui-simpledialog-container ").appendTo($("form#frmdiaLogin")); 
    return false; 
    } 

現在這個對話框被正確打開。但在關閉時拋出錯誤在

$.mobile.sdCurrentDialog.sdIntContent.find('select').each(function() { 

任何解決方案?

+0

它發生同樣的給我。你找到解決方案嗎? – 2014-04-10 03:44:56

+0

不幸的是還沒有。但我不得不前進 –

+0

你有沒有改變圖書館?如果是的話......你使用了哪個庫? – 2014-04-10 05:53:00

回答

0

我能解決的唯一方法是使用SimpleDialog2.js的未壓縮版本,並進行以下更改:

if (self.options.mode === 'blank') { 
     $.mobile.sdCurrentDialog.sdIntContent.find('select').each(function() { 
      if ($(this).data('nativeMenu') == false) { 
       $(this).data('selectmenu').menuPage.remove(); 
       $(this).data('selectmenu').screen.remove(); 
       $(this).data('selectmenu').listbox.remove(); 
      } 
     }); 
    } 

if (self.options.mode === 'blank') { 
     if ($.mobile.sdCurrentDialog) { 
      $.mobile.sdCurrentDialog.sdIntContent.find('select').each(function() { 
       if ($(this).data('nativeMenu') == false) { 
        if ($(this).data('selectmenu')) { 
         $(this).data('selectmenu').menuPage.remove(); 
         $(this).data('selectmenu').screen.remove(); 
         $(this).data('selectmenu').listbox.remove(); 
        } 
       } 
      }); 
     } 
    } 
+0

它應該從jQuery的337行開始。 mobile.SimpleDialog2.js – RebrandSoftware

相關問題