Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Open
Labels

Comments

@davidjsilva
Copy link

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.

orneryd added a commit that referenced this issue Dec 19, 2012
@ghost ghost assigned orneryd Dec 19, 2012
@orneryd orneryd closed this as completed Dec 19, 2012
@orneryd
Copy link
Contributor

orneryd commented Dec 19, 2012

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

@davidjsilva
Copy link
Author

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?

@davidjsilva
Copy link
Author

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.

@orneryd
Copy link
Contributor

orneryd commented Dec 19, 2012

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

@ms440
Copy link

ms440 commented Dec 21, 2012

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

Thanks for KoGrid, BTW. :)

@kkandala
Copy link

sortInfo gets called twice, is this issue fixed?

@orneryd orneryd removed their assignment Mar 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants