Loading ...
Sorry, an error occurred while loading the content.

Datatable - initially hidden col width

Expand Messages
  • tntnashtm123
    Hi If I start with inially hidden columns (or hide them in responce to initEvent ) when they are later shown they come up with minWidth and not sized to their
    Message 1 of 11 , Jun 23, 2008
    • 0 Attachment
      Hi

      If I start with inially hidden columns (or hide them in responce to
      "initEvent") when they are later shown they come up with minWidth and
      not sized to their text content - how do I get them to size to their
      content ?

      Thanks
      Tim
    • y_lsmith
      ... Tim, Try calling myDataTable._syncColWidths() after the column is shown. Hope this helps, Luke
      Message 2 of 11 , Jun 24, 2008
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@...>
        wrote:
        >
        > Hi
        >
        > If I start with inially hidden columns (or hide them in responce to
        > "initEvent") when they are later shown they come up with minWidth and
        > not sized to their text content - how do I get them to size to their
        > content ?
        >
        > Thanks
        > Tim
        >

        Tim,

        Try calling myDataTable._syncColWidths() after the column is shown.

        Hope this helps,
        Luke
      • tntnashtm123
        ... Thanks Luke but it did not - I am now reading and setting their widths and when they are displayed later they are the correct size. Am I missing something
        Message 3 of 11 , Jun 25, 2008
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@...> wrote:
          >
          > --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@>
          > wrote:
          > >
          > > Hi
          > >
          > > If I start with inially hidden columns (or hide them in responce to
          > > "initEvent") when they are later shown they come up with minWidth and
          > > not sized to their text content - how do I get them to size to their
          > > content ?
          > >
          > > Thanks
          > > Tim
          > >
          >
          > Tim,
          >
          > Try calling myDataTable._syncColWidths() after the column is shown.
          >
          > Hope this helps,
          > Luke
          >


          Thanks Luke but it did not - I am now reading and setting their widths
          and when they are displayed later they are the correct size.
          Am I missing something ?

          Tim

          var el = colsetKeys[i].getThEl();
          var elWidth = YAHOO.util.Dom.getStyle(el,"width");
          elWidth = elWidth.substring(0,elWidth.indexOf('px'));
          //explicitly set col widths
          myDT.setColumnWidth(colsetKeys[i],parseInt(elWidth));
          //hide some cols
          if(!(colsetKeys[i].key == 'A3'|| colsetKeys[i].key == 'Name'))
          myDT.hideColumn(colsetKeys[i]);
        • y_lsmith
          Tim, Indeed there is a bug here. I ve filed it internally. Thanks for finding it! If you want to be notified that a fix has been applied to the source, you
          Message 4 of 11 , Jun 25, 2008
          • 0 Attachment
            Tim,

            Indeed there is a bug here.  I've filed it internally.  Thanks for finding it!  If you want to be notified that a fix has been applied to the source, you can file a SourceForge bug and we'll link up the two.

            In the mean time, here's a workaround
            var myDataTable = new YAHOO.widget.DataTable(...);
            myDataTable.showColumn = function (col) {
                var c = this.getColumn(col);
                if (c) {
                    YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                    if (c.width === YAHOO.widget.Column.prototype.minWidth) {
                        c.width = null;
                        this._syncColWidths();
                    }
                }
            };
            // now showing the hidden column should expand

            Another workaround would be shorter, but involve more hard coding:
            // in the event handler code responsible for calling showColumn(..)
            myDataTable.showColumn(colName);
            if (colName == 'bar') {
                myDataTable.getColumn(colName).width = null;
                myDataTable._syncColWidths();

            }


            Hope this helps,
            Luke

            --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@...> wrote:
            >
            > --- In ydn-javascript@yahoogroups.com, "y_lsmith" lsmith@ wrote:
            > >
            > > --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@>
            > > wrote:
            > > >
            > > > Hi
            > > >
            > > > If I start with inially hidden columns (or hide them in responce to
            > > > "initEvent") when they are later shown they come up with minWidth and
            > > > not sized to their text content - how do I get them to size to their
            > > > content ?
            > > >
            > > > Thanks
            > > > Tim
            > > >
            > >
            > > Tim,
            > >
            > > Try calling myDataTable._syncColWidths() after the column is shown.
            > >
            > > Hope this helps,
            > > Luke
            > >
            >
            >
            > Thanks Luke but it did not - I am now reading and setting their widths
            > and when they are displayed later they are the correct size.
            > Am I missing something ?
            >
            > Tim
            >
            > var el = colsetKeys[i].getThEl();
            > var elWidth = YAHOO.util.Dom.getStyle(el,"width");
            > elWidth = elWidth.substring(0,elWidth.indexOf('px'));
            > //explicitly set col widths
            > myDT.setColumnWidth(colsetKeys[i],parseInt(elWidth));
            > //hide some cols
            > if(!(colsetKeys[i].key == 'A3'|| colsetKeys[i].key == 'Name'))
            > myDT.hideColumn(colsetKeys[i]);
            >
          • tntnashtm123
            ... Thnaks for the patch Luke, it works great, however child columns with the parent hidden initially still come up with minWith when shown - any fixes for
            Message 5 of 11 , Jun 26, 2008
            • 0 Attachment
              --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@...> wrote:
              >
              > Tim,
              >
              > Indeed there is a bug here. I've filed it internally. Thanks for
              > finding it! If you want to be notified that a fix has been applied to
              > the source, you can file a SourceForge bug and we'll link up the two.
              >
              > In the mean time, here's a workaround
              > var myDataTable = new YAHOO.widget.DataTable(...);
              > myDataTable.showColumn = function (col) {
              > var c = this.getColumn(col);
              > if (c) {
              > YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
              > if (c.width === YAHOO.widget.Column.prototype.minWidth) {
              > c.width = null;
              > this._syncColWidths();
              > }
              > }
              > };
              > // now showing the hidden column should expand
              >
              > Another workaround would be shorter, but involve more hard coding:
              > // in the event handler code responsible for calling showColumn(..)
              > myDataTable.showColumn(colName);
              > if (colName == 'bar') {
              > myDataTable.getColumn(colName).width = null;
              > myDataTable._syncColWidths();
              > }
              >
              > Hope this helps,
              > Luke
              >
              > --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@>
              > wrote:
              > >
              > > --- In ydn-javascript@yahoogroups.com, "y_lsmith" lsmith@ wrote:
              > > >
              > > > --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@>
              > > > wrote:
              > > > >
              > > > > Hi
              > > > >
              > > > > If I start with inially hidden columns (or hide them in responce
              > to
              > > > > "initEvent") when they are later shown they come up with minWidth
              > and
              > > > > not sized to their text content - how do I get them to size to
              > their
              > > > > content ?
              > > > >
              > > > > Thanks
              > > > > Tim
              > > > >
              > > >
              > > > Tim,
              > > >
              > > > Try calling myDataTable._syncColWidths() after the column is shown.
              > > >
              > > > Hope this helps,
              > > > Luke
              > > >
              > >
              > >
              > > Thanks Luke but it did not - I am now reading and setting their widths
              > > and when they are displayed later they are the correct size.
              > > Am I missing something ?
              > >
              > > Tim
              > >
              > > var el = colsetKeys[i].getThEl();
              > > var elWidth = YAHOO.util.Dom.getStyle(el,"width");
              > > elWidth = elWidth.substring(0,elWidth.indexOf('px'));
              > > //explicitly set col widths
              > > myDT.setColumnWidth(colsetKeys[i],parseInt(elWidth));
              > > //hide some cols
              > > if(!(colsetKeys[i].key == 'A3'|| colsetKeys[i].key == 'Name'))
              > > myDT.hideColumn(colsetKeys[i]);
              > >
              >

              Thnaks for the patch Luke, it works great, however child columns with
              the parent hidden initially still come up with minWith when shown -
              any fixes for this ?

              Thanks
              Tim
            • y_lsmith
              ... I ve updated the bug to include this detail. I d be interested to see a sample page illustrating your use case. Specifically because there s another bug
              Message 6 of 11 , Jun 27, 2008
              • 0 Attachment
                >
                > Thnaks for the patch Luke, it works great, however child columns with
                > the parent hidden initially still come up with minWith when shown -
                > any fixes for this ?
                >
                > Thanks
                > Tim
                >

                I've updated the bug to include this detail. I'd be interested to see
                a sample page illustrating your use case. Specifically because
                there's another bug whereby declaring parent headers hidden at
                construction doesn't work (the column and its children are not collapsed).

                You might be able to get away with something like this:
                YAHOO.widget.Column.correctAutoWidth = function () {
                if (this.width === this.minWidth &&
                this.width === YAHOO.widget.Column.prototype.minWidth) {
                this.width = null;
                if (YAHOO.lang.isArray(this.children)) {
                for (var i = this.children.length - 1; i >= 0; --i) {
                this.children[i].correctAutoWidth();
                }
                }
                }
                };

                // ... construct the DataTable instance, then

                myDataTable.showColumn = function (col) {
                var c = this.getColumn(col);
                if (c) {
                YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                c.correctAutoWidth();
                this._syncColWidths();
                }
                };

                Not thoroughly tested, so YMMV.

                Luke
              • tntnashtm123
                ... collapsed). ... Luke - I was/am hiding the nested cols in response to the DataTable init event so it is not an initially hidden col although the
                Message 7 of 11 , Jun 30, 2008
                • 0 Attachment
                  --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@...> wrote:
                  >
                  > >
                  > > Thnaks for the patch Luke, it works great, however child columns with
                  > > the parent hidden initially still come up with minWith when shown -
                  > > any fixes for this ?
                  > >
                  > > Thanks
                  > > Tim
                  > >
                  >
                  > I've updated the bug to include this detail. I'd be interested to see
                  > a sample page illustrating your use case. Specifically because
                  > there's another bug whereby declaring parent headers hidden at
                  > construction doesn't work (the column and its children are not
                  collapsed).
                  >
                  > You might be able to get away with something like this:
                  > YAHOO.widget.Column.correctAutoWidth = function () {
                  > if (this.width === this.minWidth &&
                  > this.width === YAHOO.widget.Column.prototype.minWidth) {
                  > this.width = null;
                  > if (YAHOO.lang.isArray(this.children)) {
                  > for (var i = this.children.length - 1; i >= 0; --i) {
                  > this.children[i].correctAutoWidth();
                  > }
                  > }
                  > }
                  > };
                  >
                  > // ... construct the DataTable instance, then
                  >
                  > myDataTable.showColumn = function (col) {
                  > var c = this.getColumn(col);
                  > if (c) {
                  > YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                  > c.correctAutoWidth();
                  > this._syncColWidths();
                  > }
                  > };
                  >
                  > Not thoroughly tested, so YMMV.
                  >
                  > Luke
                  >


                  Luke - I was/am hiding the nested cols in response to the DataTable
                  init event so it is not an "initially hidden" col although the
                  behavior is similar.

                  thanks
                  Tim
                • y_lsmith
                  Tim, Ok, good to know. I ll add a test case for that scenario. In the mean time, this appears to work in my dev env: // Instantiate myDataTable
                  Message 8 of 11 , Jun 30, 2008
                  • 0 Attachment
                    Tim,

                    Ok, good to know.  I'll add a test case for that scenario.

                    In the mean time, this appears to work in my dev env:
                    // Instantiate myDataTable
                    myDataTable.showColumn = function (col) {
                        var dt = this;
                        function fixWidth(col) {
                            var c = dt.getColumn(col), children, i;
                            if (c) {
                                if (c.width = YAHOO.widget.Column.prototype.minWidth) {
                                    c.width = null;
                                }

                                children = c.children || [];
                                for (i = children.length - 1; i >= 0; --i) {
                                    fixWidth(children[i].key);
                                }
                            }
                        }

                        YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                        fixWidth(col);
                        this._syncColWidths();
                    };


                    Hope this helps,
                    Luke


                    --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@...> wrote:
                    >
                    > --- In ydn-javascript@yahoogroups.com, "y_lsmith" lsmith@ wrote:
                    > >
                    > > >
                    > > > Thnaks for the patch Luke, it works great, however child columns with
                    > > > the parent hidden initially still come up with minWith when shown -
                    > > > any fixes for this ?
                    > > >
                    > > > Thanks
                    > > > Tim
                    > > >
                    > >
                    > > I've updated the bug to include this detail. I'd be interested to see
                    > > a sample page illustrating your use case. Specifically because
                    > > there's another bug whereby declaring parent headers hidden at
                    > > construction doesn't work (the column and its children are not
                    > collapsed).
                    > >
                    > > You might be able to get away with something like this:
                    > > YAHOO.widget.Column.correctAutoWidth = function () {
                    > > if (this.width === this.minWidth &&
                    > > this.width === YAHOO.widget.Column.prototype.minWidth) {
                    > > this.width = null;
                    > > if (YAHOO.lang.isArray(this.children)) {
                    > > for (var i = this.children.length - 1; i >= 0; --i) {
                    > > this.children[i].correctAutoWidth();
                    > > }
                    > > }
                    > > }
                    > > };
                    > >
                    > > // ... construct the DataTable instance, then
                    > >
                    > > myDataTable.showColumn = function (col) {
                    > > var c = this.getColumn(col);
                    > > if (c) {
                    > > YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                    > > c.correctAutoWidth();
                    > > this._syncColWidths();
                    > > }
                    > > };
                    > >
                    > > Not thoroughly tested, so YMMV.
                    > >
                    > > Luke
                    > >
                    >
                    >
                    > Luke - I was/am hiding the nested cols in response to the DataTable
                    > init event so it is not an "initially hidden" col although the
                    > behavior is similar.
                    >
                    > thanks
                    > Tim
                    >
                  • tntnashtm123
                    ... Thanks Luke That works ! Last request - is there a patch to allow nested cols to be hidden initially (via config object). As I mentitioned earlier I am
                    Message 9 of 11 , Jul 2, 2008
                    • 0 Attachment
                      --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@...> wrote:
                      >
                      > Tim,
                      >
                      > Ok, good to know. I'll add a test case for that scenario.
                      >
                      > In the mean time, this appears to work in my dev env:
                      > // Instantiate myDataTable
                      > myDataTable.showColumn = function (col) {
                      > var dt = this;
                      > function fixWidth(col) {
                      > var c = dt.getColumn(col), children, i;
                      > if (c) {
                      > if (c.width = YAHOO.widget.Column.prototype.minWidth) {
                      > c.width = null;
                      > }
                      >
                      > children = c.children || [];
                      > for (i = children.length - 1; i >= 0; --i) {
                      > fixWidth(children[i].key);
                      > }
                      > }
                      > }
                      >
                      > YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                      > fixWidth(col);
                      > this._syncColWidths();
                      > };
                      >
                      > Hope this helps,
                      > Luke
                      >
                      >
                      > --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@>
                      > wrote:
                      > >
                      > > --- In ydn-javascript@yahoogroups.com, "y_lsmith" lsmith@ wrote:
                      > > >
                      > > > >
                      > > > > Thnaks for the patch Luke, it works great, however child columns
                      > with
                      > > > > the parent hidden initially still come up with minWith when shown
                      > -
                      > > > > any fixes for this ?
                      > > > >
                      > > > > Thanks
                      > > > > Tim
                      > > > >
                      > > >
                      > > > I've updated the bug to include this detail. I'd be interested to
                      > see
                      > > > a sample page illustrating your use case. Specifically because
                      > > > there's another bug whereby declaring parent headers hidden at
                      > > > construction doesn't work (the column and its children are not
                      > > collapsed).
                      > > >
                      > > > You might be able to get away with something like this:
                      > > > YAHOO.widget.Column.correctAutoWidth = function () {
                      > > > if (this.width === this.minWidth &&
                      > > > this.width === YAHOO.widget.Column.prototype.minWidth) {
                      > > > this.width = null;
                      > > > if (YAHOO.lang.isArray(this.children)) {
                      > > > for (var i = this.children.length - 1; i >= 0; --i) {
                      > > > this.children[i].correctAutoWidth();
                      > > > }
                      > > > }
                      > > > }
                      > > > };
                      > > >
                      > > > // ... construct the DataTable instance, then
                      > > >
                      > > > myDataTable.showColumn = function (col) {
                      > > > var c = this.getColumn(col);
                      > > > if (c) {
                      > > > YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                      > > > c.correctAutoWidth();
                      > > > this._syncColWidths();
                      > > > }
                      > > > };
                      > > >
                      > > > Not thoroughly tested, so YMMV.
                      > > >
                      > > > Luke
                      > > >
                      > >
                      > >
                      > > Luke - I was/am hiding the nested cols in response to the DataTable
                      > > init event so it is not an "initially hidden" col although the
                      > > behavior is similar.
                      > >
                      > > thanks
                      > > Tim
                      > >
                      >


                      Thanks Luke

                      That works !

                      Last request - is there a patch to allow nested cols to be hidden
                      initially (via config object). As I mentitioned earlier I am hiding
                      the nested cols in responce to the init event but this is very slow in
                      IE7.

                      Thanks
                      Tim
                    • y_lsmith
                      ... shown ... YAHOO.widget.DataTable.prototype.showColumn.call(this,col); ... There s no patch yet for initially hidden parent columns via the config.
                      Message 10 of 11 , Jul 2, 2008
                      • 0 Attachment
                        --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@...>
                        wrote:
                        >
                        > --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@> wrote:
                        > >
                        > > Tim,
                        > >
                        > > Ok, good to know. I'll add a test case for that scenario.
                        > >
                        > > In the mean time, this appears to work in my dev env:
                        > > // Instantiate myDataTable
                        > > myDataTable.showColumn = function (col) {
                        > > var dt = this;
                        > > function fixWidth(col) {
                        > > var c = dt.getColumn(col), children, i;
                        > > if (c) {
                        > > if (c.width = YAHOO.widget.Column.prototype.minWidth) {
                        > > c.width = null;
                        > > }
                        > >
                        > > children = c.children || [];
                        > > for (i = children.length - 1; i >= 0; --i) {
                        > > fixWidth(children[i].key);
                        > > }
                        > > }
                        > > }
                        > >
                        > > YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                        > > fixWidth(col);
                        > > this._syncColWidths();
                        > > };
                        > >
                        > > Hope this helps,
                        > > Luke
                        > >
                        > >
                        > > --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@>
                        > > wrote:
                        > > >
                        > > > --- In ydn-javascript@yahoogroups.com, "y_lsmith" lsmith@ wrote:
                        > > > >
                        > > > > >
                        > > > > > Thnaks for the patch Luke, it works great, however child columns
                        > > with
                        > > > > > the parent hidden initially still come up with minWith when
                        shown
                        > > -
                        > > > > > any fixes for this ?
                        > > > > >
                        > > > > > Thanks
                        > > > > > Tim
                        > > > > >
                        > > > >
                        > > > > I've updated the bug to include this detail. I'd be interested to
                        > > see
                        > > > > a sample page illustrating your use case. Specifically because
                        > > > > there's another bug whereby declaring parent headers hidden at
                        > > > > construction doesn't work (the column and its children are not
                        > > > collapsed).
                        > > > >
                        > > > > You might be able to get away with something like this:
                        > > > > YAHOO.widget.Column.correctAutoWidth = function () {
                        > > > > if (this.width === this.minWidth &&
                        > > > > this.width === YAHOO.widget.Column.prototype.minWidth) {
                        > > > > this.width = null;
                        > > > > if (YAHOO.lang.isArray(this.children)) {
                        > > > > for (var i = this.children.length - 1; i >= 0; --i) {
                        > > > > this.children[i].correctAutoWidth();
                        > > > > }
                        > > > > }
                        > > > > }
                        > > > > };
                        > > > >
                        > > > > // ... construct the DataTable instance, then
                        > > > >
                        > > > > myDataTable.showColumn = function (col) {
                        > > > > var c = this.getColumn(col);
                        > > > > if (c) {
                        > > > >
                        YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                        > > > > c.correctAutoWidth();
                        > > > > this._syncColWidths();
                        > > > > }
                        > > > > };
                        > > > >
                        > > > > Not thoroughly tested, so YMMV.
                        > > > >
                        > > > > Luke
                        > > > >
                        > > >
                        > > >
                        > > > Luke - I was/am hiding the nested cols in response to the DataTable
                        > > > init event so it is not an "initially hidden" col although the
                        > > > behavior is similar.
                        > > >
                        > > > thanks
                        > > > Tim
                        > > >
                        > >
                        >
                        >
                        > Thanks Luke
                        >
                        > That works !
                        >
                        > Last request - is there a patch to allow nested cols to be hidden
                        > initially (via config object). As I mentitioned earlier I am hiding
                        > the nested cols in responce to the init event but this is very slow in
                        > IE7.
                        >
                        > Thanks
                        > Tim
                        >

                        There's no patch yet for initially hidden parent columns via the
                        config. However, you don't need to wait for the initEvent to declare
                        a column hidden. You can do
                        var myDataTable = new YAHOO.widget.DataTable('tbl',allVisibleCols,...);
                        myDataTable.hideColumn('parent');

                        This should be even more performant for XHR DataSources, since only
                        the headers will be rendered before the repaint required by the column
                        hide operation. By the time the data arrives for rendering, the
                        columns will be declared as hidden so the data rows will only need to
                        render once.

                        Luke
                      • tntnashtm123
                        ... columns ... interested to ... --i) { ... DataTable ... thanks again Luke That is a great solution which never occurred to me ! Thanks for your great
                        Message 11 of 11 , Jul 3, 2008
                        • 0 Attachment
                          --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@...> wrote:
                          >
                          > --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@>
                          > wrote:
                          > >
                          > > --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@> wrote:
                          > > >
                          > > > Tim,
                          > > >
                          > > > Ok, good to know. I'll add a test case for that scenario.
                          > > >
                          > > > In the mean time, this appears to work in my dev env:
                          > > > // Instantiate myDataTable
                          > > > myDataTable.showColumn = function (col) {
                          > > > var dt = this;
                          > > > function fixWidth(col) {
                          > > > var c = dt.getColumn(col), children, i;
                          > > > if (c) {
                          > > > if (c.width = YAHOO.widget.Column.prototype.minWidth) {
                          > > > c.width = null;
                          > > > }
                          > > >
                          > > > children = c.children || [];
                          > > > for (i = children.length - 1; i >= 0; --i) {
                          > > > fixWidth(children[i].key);
                          > > > }
                          > > > }
                          > > > }
                          > > >
                          > > > YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                          > > > fixWidth(col);
                          > > > this._syncColWidths();
                          > > > };
                          > > >
                          > > > Hope this helps,
                          > > > Luke
                          > > >
                          > > >
                          > > > --- In ydn-javascript@yahoogroups.com, "tntnashtm123" <nash.rsa@>
                          > > > wrote:
                          > > > >
                          > > > > --- In ydn-javascript@yahoogroups.com, "y_lsmith" lsmith@ wrote:
                          > > > > >
                          > > > > > >
                          > > > > > > Thnaks for the patch Luke, it works great, however child
                          columns
                          > > > with
                          > > > > > > the parent hidden initially still come up with minWith when
                          > shown
                          > > > -
                          > > > > > > any fixes for this ?
                          > > > > > >
                          > > > > > > Thanks
                          > > > > > > Tim
                          > > > > > >
                          > > > > >
                          > > > > > I've updated the bug to include this detail. I'd be
                          interested to
                          > > > see
                          > > > > > a sample page illustrating your use case. Specifically because
                          > > > > > there's another bug whereby declaring parent headers hidden at
                          > > > > > construction doesn't work (the column and its children are not
                          > > > > collapsed).
                          > > > > >
                          > > > > > You might be able to get away with something like this:
                          > > > > > YAHOO.widget.Column.correctAutoWidth = function () {
                          > > > > > if (this.width === this.minWidth &&
                          > > > > > this.width === YAHOO.widget.Column.prototype.minWidth) {
                          > > > > > this.width = null;
                          > > > > > if (YAHOO.lang.isArray(this.children)) {
                          > > > > > for (var i = this.children.length - 1; i >= 0;
                          --i) {
                          > > > > > this.children[i].correctAutoWidth();
                          > > > > > }
                          > > > > > }
                          > > > > > }
                          > > > > > };
                          > > > > >
                          > > > > > // ... construct the DataTable instance, then
                          > > > > >
                          > > > > > myDataTable.showColumn = function (col) {
                          > > > > > var c = this.getColumn(col);
                          > > > > > if (c) {
                          > > > > >
                          > YAHOO.widget.DataTable.prototype.showColumn.call(this,col);
                          > > > > > c.correctAutoWidth();
                          > > > > > this._syncColWidths();
                          > > > > > }
                          > > > > > };
                          > > > > >
                          > > > > > Not thoroughly tested, so YMMV.
                          > > > > >
                          > > > > > Luke
                          > > > > >
                          > > > >
                          > > > >
                          > > > > Luke - I was/am hiding the nested cols in response to the
                          DataTable
                          > > > > init event so it is not an "initially hidden" col although the
                          > > > > behavior is similar.
                          > > > >
                          > > > > thanks
                          > > > > Tim
                          > > > >
                          > > >
                          > >
                          > >
                          > > Thanks Luke
                          > >
                          > > That works !
                          > >
                          > > Last request - is there a patch to allow nested cols to be hidden
                          > > initially (via config object). As I mentitioned earlier I am hiding
                          > > the nested cols in responce to the init event but this is very slow in
                          > > IE7.
                          > >
                          > > Thanks
                          > > Tim
                          > >
                          >
                          > There's no patch yet for initially hidden parent columns via the
                          > config. However, you don't need to wait for the initEvent to declare
                          > a column hidden. You can do
                          > var myDataTable = new YAHOO.widget.DataTable('tbl',allVisibleCols,...);
                          > myDataTable.hideColumn('parent');
                          >
                          > This should be even more performant for XHR DataSources, since only
                          > the headers will be rendered before the repaint required by the column
                          > hide operation. By the time the data arrives for rendering, the
                          > columns will be declared as hidden so the data rows will only need to
                          > render once.
                          >
                          > Luke
                          >

                          thanks again Luke

                          That is a great solution which never occurred to me !

                          Thanks for your great support !

                          Tim
                        Your message has been successfully submitted and would be delivered to recipients shortly.