2016-06-30 5 views
0

xls을 통해 처리 된 파일이 HTML로 변환되어 Extjs로 렌더링되었습니다. 제 문제는 이미지 링크가 xls에 있다는 것입니다. 이미지를 클릭 할 때 iamge URL이 함수 호출을 통해 호출되지 않았으므로 이미지를 볼 수 없습니다.이미지 클릭시 ext.js 모달 창에 이미지를 표시하고 싶습니다.

어떻게받을 수 있습니까?

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

, 당신은 변수를 사용하지 않을 때, 캐릭터 라인 여기 내 code--

는 ExtJS입니다 "url".

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

및 (디렉토리에서 대체 검색 &처럼도의 ExtJS 개발에 유용한 다른 기능을 가지고 있습니다,) 예를 Notepad++를위한 구문 강조와 편집기를 얻을 다음보십시오.

+0

감사합니다. :) – divein

관련 문제