Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Stoffel Armin on Oct 16, 2008 12:13
open dhtmlx forum
Normal HTML Code in the Layout

How can I add a normal HTML Code in the Layout?
Example:
A request returns the following code:
<div id='idHeader'><div id='idHeaderText'>Text</div><img id='idLogo' alt='' src='/graphics/logo.gif' width='225' height='45'></div>
Without DHTMLX: document.getElementById("idMain").innerHTML = "<div id='idHeader'><div id='idHeaderText'>Text</div><img id='idLogo' alt='' src='/graphics/logo.gif' width='225' height='45'></div>"
Answer posted by Support on Oct 17, 2008 00:55
Hello,

try something like this:
dhxLayout.cells("a").attachObject("idHeader");
Answer posted by Stoffel Armin on Oct 17, 2008 01:57
But the div comes as text from a request. It's not an object in the side. How can I change the text in an object?
Answer posted by Support on Oct 17, 2008 02:08
You can do it by passing text into innerHTML like this:

dhxLayout.cells("a").window._content.childNodes[2].innerHTML = "your text";
Answer posted by Stoffel Armin on Oct 17, 2008 03:15
Thanks

How should I make a standard formular in a layout? With a grid? What prefers dhtmlx?
Answer posted by Support on Oct 17, 2008 03:28
Sorry, I'm not sure that understood your question correctly. 
If you mean adding grid and other components to layout -it can be done through methods of layout, for the grid it will be 

var mygrid = dhxLayout.cells("a").attachGrid;
... any grid configuration code here ...
Answer posted by Stoffel Armin on Oct 17, 2008 04:05

I create a Layout:
var dhxLayout = new dhtmlXLayoutObject("parentId", "2U")

Now I try to add a HTML form:
One way is now: dhxLayout.cells("a").window._content.childNodes[2].innerHTML = "<form action.... </form>"

Have you a better idea to add standard HTML to the DHTML objects?
The form code comes from a request. A request is not an object.

General idea:
Layout 2U
left side a tree.
if you click an item, it shows a html form on the right side. Not a grid or another dhtmlx object.
this form comes from a request and is not at the beginning on the site.

I found no samples on this website.
Answer posted by Stoffel Armin on Oct 17, 2008 05:49
No idea? :-(
Answer posted by Support on Oct 20, 2008 05:33
Why don't you use attachURL() method? It will load html.page directly into cell.