2012-02-12 113 views
0

我對網絡編程有點新鮮。使用DHTML 3.0 Visual Designer我創建了一個小網頁用下面自動生成的代碼:DHTMLX可視化編輯器。如何使用生成的代碼

dhtmlx.image_path='./codebase/imgs/'; 

    var main_layout = new dhtmlXLayoutObject(document.body, '1C'); 

    var a = main_layout.cells('a'); 
    a.setHeight('0'); 
    a.setWidth('0'); 
    a.hideHeader(); 
    a.fixSize(0,1); 
    var toolbar_2 = a.attachToolbar(); 
    toolbar_2.setIconsPath('./codebase/imgs/'); 

    toolbar_2.loadXMLString('<toolbar><item type="button" text="" img="dhtmlxSuite/dhtmlxToolbar/codebase/imgs/dhxtoolbar_dhx_web/save.gif" imgdis="" title="Actualizar" /><item type="button" text="" img="dhtmlxSuite/dhtmlxToolbar/codebase/imgs/dhxtoolbar_dhx_web/text_document.gif" imgdis="" title="Editar" /><item type="button" text="" img="dhtmlxSuite/dhtmlxToolbar/codebase/imgs/dhxtoolbar_dhx_web/print.gif" imgdis="" title="Imprimir" /></toolbar>', function(){}); 

    var toolbar_1 = main_layout.attachToolbar(); 
    toolbar_1.setIconsPath('./codebase/imgs/'); 

    toolbar_1.loadXMLString('<toolbar><item type="button" text="N1" img="" /><item type="separator" /><item type="button" text="N2" /><item type="separator" /><item type="button" text="N3" img="" /><item type="separator" /><item type="button" text="N4" /><item type="separator" /><item type="button" text="N5" /></toolbar>', function(){}); 

我不知道如何把這個代碼轉換成HTML頁面。我試圖用<script>標籤圍繞此代碼,創建function doOnLoad(),然後添加<body onload="doOnLoad()" style="width:100%; height:100%; margin:0px; overflow:hidden;">。但它不起作用。

回答

1

檢查the docs

您需要

  • 地方基礎html標籤
  • 包括dhtmlx.js和dhtmlx.css
  • 地方腳本塊,並將代碼從設計師粘貼
相關問題