mitchellsimoens / Ext.ux.touch.grid

Grid components for Sencha Touch 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hideColumn, toggleColumn do not work

donaldruby opened this issue · comments

hideColumn and toggleColumn only hide the column header, but the column itself is still visible.

This is due to a bug in Sencha Touch 2.1.0 that should be fixed in 2.1.1. The bug is the List did not accept a new template if you execute setItemTpl method which happens when you hide/show a column.

Any idea when this issue will be fixed in 2.1.1? I've got a nightly build of 2.1.1 (from Jan 24) and isn't fixed there. I'm trying to migrate from 2.0 and I would really appreciate if you can offer any workaround. Thanks.

I will not be fixing framework bugs for my extensions.

Fair enough. I found a fix for this, but works only for 2.1, not 2.0, since there is no function updateItemTpl(newTpl, oldTpl) defined in the parent class:

updateItemTpl : function (newTpl, oldTpl) {
    this.callParent(arguments);

    var header = this.getHeader(),
        html = this._buildTpl(this.getColumns(), true);

    header.setHtml(html.tpl);

    this.refresh();
},

Any suggestions? I can submit the fix, if the extension will only support 2.1.

Thanks.

Correction: the previous fix, actually, works for 2.1.1, not 2.1.

Mitchell, perhaps if you were a bit nicer you would not have so much trouble making friends! Just a suggestion.

Sent from my iPad

On Jan 28, 2013, at 10:58 AM, Mitchell Simoens notifications@github.com wrote:

I will not be fixing framework bugs for my extensions.


Reply to this email directly or view it on GitHub.

@donaldruby I have no problems making friends.

Also, you should not be assuming tone in text as there was no negative tone in it. Just a suggestion.

Mitchell, You mentioned you were having that trouble in your blog awhile back. Anyway, Adrian asked you two questions, and you basically just blew them off.

On Jan 28, 2013, at 1:31 PM, Mitchell Simoens notifications@github.com wrote:

@donaldruby I have no problems making friends. Also, you should not be assuming tone in text as there was no negative tone in it.


Reply to this email directly or view it on GitHub.

Not trouble, just how it was when I was little. Anyway, didn't blow him off. He knew there was a bug in 2.1.0, asked if I was going to fix it in my grid, and I said no.

He was actually asking if you knew when the bug would be fixed in ST library. And also if you could suggest a workaround.

Sent from my iPad

On Jan 28, 2013, at 2:04 PM, Mitchell Simoens notifications@github.com wrote:

Not trouble, just how it was when I was little. Anyway, didn't blow him off. He knew there was a bug in 2.1.0, asked if I was going to fix it in my grid, and I said no.


Reply to this email directly or view it on GitHub.

Mitchell, the question was when the bug will be fixed in Sencha Touch 2.1.1, since you mention that. Anyway, as I can fix issues in the touch grid like I did before. However, in the meantime I have the fix for the grid, but it will only work with 2.1.1, since the API changed from 2.1. Please find a minute and let me know if you are OK with it, so I can submit it and make available for everyone. Thanks.

I'm told it will be in 2.1.1 but haven't tested it myself.

@donaldruby gotta love being like you are publicly especially since you gain nothing. If you want a workaround, you can open a ticket at support.sencha.com (or search the forums as it's there) and Sencha (yes I work for Sencha but this extension is not Sencha's so I'm not speaking for them here) can provide a workaround. I'm not going to because this will be fixed in the framework.

Since @donaldruby seems to have a chip on his shoulder for me, I will be unwatching this thread so I don't get notified of any changes.

If using Sencha Touch 2.1, here is the fix for the touch grid (List.js):

_updateItemTpl: function(newTpl) {
    var listItems = this.listItems,
        ln = listItems.length || 0,
        store = this.getStore(),
        i, listItem;

    for (i = 0; i < ln; i++) {
        listItem = listItems[i];
        listItem.setTpl(newTpl);
    }

    if (store && store.getCount()) {
        this.doRefresh();
    }
},

updateItemTpl : function () {
    this._updateItemTpl(this.getItemTpl());

    var header = this.getHeader(),
        html = this._buildTpl(this.getColumns(), true);

    header.setHtml(html.tpl);

    this.refresh();
},

Thanks!