2016-06-30 35 views
0

我有一個文件,它通過xls處理並轉換爲HTML並呈現爲Extjs。我的問題是圖像鏈接在xls。點擊圖片後,我無法看到圖片,因爲它的iamge URL沒有通過函數調用進行調用。我想要在ext.js模式窗口中顯示圖像

我該如何得到它? 這裏是我的代碼 -

ExtJS的: -

var showModal = function(url){ 
    var previewWindow = new Ext.Window({ 
     modal:true, 
     border:false, 
     plain:true, 
     width:500, 
     height:500, 
     constrain:true, 
     html:'<div style="width:500px;height:500px;"><img src="url"></div>', 
     resizable:{preserveAspectRatio: true} 
    }); 
    previewWindow.show(); 
}; 

Xls變壓器代碼: -

<xsl:when test="@align='left'"> 
    <div class="imageleft"> 
     <img width="{$image_width}" height="{$image_height}" 
      class="image" src="vll/getImage?resource={$image_ref}" 
      onClick="showModal('vll/getImage?resource={$image_ref}')" > 
       <xsl:apply-templates/> 
     </img> 
    </div> 
</xsl:when> 

回答

0

正如你在語法高亮看,你是不是使用變量,但是字符串「URL」。請嘗試以下操作:

html:'<div style="width:500px;height:500px;"><img src="'+url+'"></div>', 

,並得到與語法高亮的編輯器,例如Notepad++(其中也有在ExtJS的發展是有益的其他功能,如搜索&替換目錄)。

+0

感謝它工作:) – divein