2013-05-25 3 views
1

내 웹 사이트에 두 개의 프레임이 있습니다. 탐색 모음이있는 프레임 A와 주 내용이있는 다른 프레임 B가 표시됩니다.jquery에서 대상 프레임 셋에 페이지를 렌더링하는 방법은 무엇입니까?

프레임 A는 내 컴퓨터에 모든 파일 이름을 표시 할 수있는 jstree 객체 인 디렉토리 목록입니다.

프레임 A는 프레임 A를 동시에 클릭하는 동안 파일의 내용을 표시하지만 폴더를 클릭하면 프레임 A의 폴더가 소모됩니다. 즉, 프레임 A를 클릭하는 동안 두 개의 이벤트가 발생합니다 (폴더 인 경우 프레임 A의 폴더를 소비하고 프레임 B의 폴더 경로 만 표시).

이제 프레임을 소비 할 수는 있지만 프레임 A의 파일 이름을 클릭하는 동안 프레임 B는 파일의 내용을 표시하지 않습니다. 프레임 B에 파일의 내용을 표시하려면 어떻게해야합니까?

def get_render_conf_text_info(request): 
    if request.method == "POST": 
     tmp_file_text = "" 
     tmp_file_path = "" 
     .... 
     tmp_form = FileForm(initial = {'path' : tmp_file_path, 'text' : tmp_file_text}) 
     return render_to_response('conf_nav_right2.html', {'form' : tmp_form}, context_instance=RequestContext(request)) 
    else: 
     tmp_form = FileForm(initial = {'path' : '', 'text' : ''}) 
     return render_to_response('conf_nav_right2.html', {'form' : tmp_form}, context_instance=RequestContext(request)) 

는 HTML 코드에서 : 나는 프레임 A에서 파일의 이름을 클릭하는 동안이 양식을 사용하여 HTML을 생성 할 수

class FileForm(forms.Form): 
    path = forms.CharField(max_length = 300, label = u"file path", help_text = u"file full path", error_messages = {"required" : ""}) 
    text = forms.CharField(max_length = 300, widget = forms.Textarea, label = u"file text", help_text = u"file content", error_messages = {"required" : ""}) 

:

프레임 B의 페이지는 장고 양식입니다 (사용 jstree.js)와 같은 프레임 A :

<ul> 
<li id="file_0_a1.cfg" class="0 jstree-close jstree-leaf" value="0" rel="file"> 
    <ins class="jstree-icon">&nbsp;</ins> 
    <a href="#" class="jstree-clicked" target="conf_nav_right"> 
     <ins class="jstree-icon">&nbsp;</ins> 
     a1.cfg 
    </a> 
</li> 
<li id="folder_1_remote" class="1 jstree-close jstree-leaf" value="0" rel="folder"> 
    <ins class="jstree-icon">&nbsp;</ins> 
    <a href="#" class=""> 
     <ins class="jstree-icon">&nbsp;</ins> 
     remote 
    </a> 
</li> 
</ul> 

"conf_nav_right "은 프레임 B의 이름입니다.

어떤 도움도 받으실 수 있습니다!

답변

0

마지막으로이 문제를 해결하기 위해 htmldocument에서 write() 함수를 사용하십시오.

이 문제가 발생하는 경우 시도해보십시오.

관련 문제