DHTMLX 4.0 Layout attachFooter

I creted simple DIV containing some text. When I try to use myLayout.attachFooter(‘id_of_my_div’) the whole layout stops loading and I receive the following error:

Uncaught TypeError: Cannot read property ‘sep’ of undefined dhtmlx.js:9
dhtmlXLayoutObject.attachFooter dhtmlx.js:9
(anonymous function)

This in Chrome.

In IE I get “this.sep.sep is empty”

Hi

please provide init code and layout pattern?

I am having the same problem.

Here’s the init code for mine.

<?php print_r($_SESSION); ?>
My Footer

LAYOUT = new dhtmlXLayoutObject({

    parent:     document.body,    		// id/object, parent container where the layout will be located
    pattern:    "1C",           // string, layout's pattern
    skin:       "dhx_terrace",  // string, optional, "dhx_skyblue", "dhx_web", "dhx_terrace"

    cells: [    // optional, cells configuration according to the pattern
                // you can specify only the cells you want to configure
                // all params are optional
        {
            id:             "a",        // id of the cell you want to configure
            text:           "",     // header text
            collapsed_text: "",   // header text for a collapsed cell
            header:         false,      // hide header on init
            width:          100,        // cell init width
            height:         100,        // cell init height
            collapse:       false        // collapse on init
            fix_size:       [true,null] // fix cell's size, [width,height]
        }
    ]
});

LAYOUT.attachHeader("header");
LAYOUT.attachFooter("footer");

Hi

please include attached file with fix for attachFooter.
we will include it into next update, if you have pro-license you can open ticket in a support system and get updated version earlier

just include js on a page, for example:

[code]

[/code]

1.zip (600 Bytes)

This solution works. Thanks.

In the newest version I have: 4.0.3 I cannot add Footer in IE8.

I receive the following error:
incorrect argument in line 9.

I used debugging tools and found that all is about the following part of the code:

dhtmlXLayoutObject.prototype.attachFooter=function(g,a){if(this.dataNodes.faObj!=null){return}if(typeof(g)!=“object”){g=document.getElementById(g)}this.dataNodes.faObj=document.createElement(“DIV”);this.dataNodes.faObj.className=“dhxlayout_ftr_attached”;this.dataNodes.faObj.style.height=(a||g.offsetHeight)+“px”;var c=(this.dataNodes.sbObj||(this.conf.pattern==“1C”?this.cdata.a:this.sep.sep));if(this.base.lastChild==c){this.base.appendChild(this.dataNodes.faObj)}else{this.base.insertBefore(this.dataNodes.faObj,c.nextSibling)}

klysiak
How can we reproduce the issue?

Please enter this site:
dev.esos.net.pl/test

Hi to all
here is a fix for fix attached above :slight_smile:
fixed_fix_[colon_and_trailing_bracket].zip (603 Bytes)

Hi all,

The framework is really great, but I have the problem similar to this.
I’m trying to test a layout and it gives error on both document.body as
well as

id.
I have loaded the error view


of Chrome as well as individual code files.
Please advice.

-thanks,
Vinu
Archive.zip (1.84 KB)

Hi

  1. Please check recommended init way here
    docs.dhtmlx.com/layout__init.htm … dedinitway

  2. html, body { height: 100% … css also needed

  3. layout_attach_footer.js is missing in archive, but if it above fix - it already included into 4.1 codebase

  4. why are you init layout using div width 100% w/h instead of using document.body?

This is the latest 4.1 version that Iam using. Guys please help

Ok let me try it. I tried document.body, so when it did not work tried to use DIV

Brilliant! thank You.

I used the following(in app.js) based on your suggestion:
$(function () {
// jquery document ready

dhxLayout = new dhtmlXLayoutObject(document.body, "1C");

});

Looks like the DHTMLX layout was loading before the document load was complete.
Thank you for your help. As always DHTMLX has been a great framework and excellent support from you.

Yes, you are always need to use something like doOnLoad function (like in samples)


Or the same thing using jQuery, like you do

Layout’s parent is “layououtObj” (div on the document.body) or document.body itselt. It must be loaded BEFORE you load your components to come “parent” for them