Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

self.sortData has javascript error 'sortInfo is not defined' in 2 spots #174

Open
davidjsilva opened this Issue Dec 19, 2012 · 6 comments

Comments

Projects
None yet
4 participants
self.sortData = function (col, direction) {
        // if external sorting is being used, do nothing.
        self.isSorting = true;
        self.sortInfo({
            column: col,
            direction: direction
        });
        self.clearSortingData(col);
        if(!self.config.useExternalSorting){
            window.kg.sortService.Sort(sortInfo, self.sortedData);
        } else {
            self.config.sortInfo(sortInfo);
        }
        self.lastSortedColumn = col;
        self.isSorting = false;
    };

The sortInfo variable is not defined and therefore throws a javascript Uncaught ReferenceError: sortInfo is not defined. You can see it in the following fiddle as well - http://jsfiddle.net/zSpMh/2/ after you try sorting the first column.

timothyswt added a commit that referenced this issue Dec 19, 2012

@ghost ghost assigned timothyswt Dec 19, 2012

@timothyswt timothyswt closed this Dec 19, 2012

Contributor

timothyswt commented Dec 19, 2012

This should fix the issue :). Thanks for finding that!

OK so after that fix my computed function which responds to any changes to sortInfo gets called twice. See fiddle console log for example http://jsfiddle.net/zSpMh/3/. Do I have to change the way I do my computed function? Or maybe does that new hotfix need to change?

I want to say that self.sortInfo has a reference to self.config.sortInfo because if you evaluate self.sortInfo() === self.config.sortInfo() in that self.sortData function it always evaluates to true. Not sure if that helps.

Contributor

timothyswt commented Dec 19, 2012

I'll look into it, I am going to change the title but it should only get called once.

@timothyswt timothyswt reopened this Dec 19, 2012

ms440 commented Dec 21, 2012

I'm also getting into the same problem. The serverside sorting gets called twice.

Thanks for KoGrid, BTW. :)

sortInfo gets called twice, is this issue fixed?

@timothyswt timothyswt removed their assignment Mar 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment