Skip to content

Problem sorting numbers #19

Description

@peter-walter

I have the following simplified configuration

        var columns = {
            name: 'Name',
            count: 'Count'
        };

        var data = [
            { name: 'D', count: '0' },
            { name: 'A', count: '16' },
            { name: 'B', count: '151' },
            { name: 'C', count: '11' },
            { name: 'F', count: '44' },
            { name: 'E', count: '5' }
        ];  

        var table = jQuery('#table-sortable').tableSortable({
            data: data,
            columns: columns,
            pagination: false
        });

When sorting against the 'count' column you will see the numbers 151 and 44 are incorrectly sorted.
image
image

I have tried removing the quotes around the numbers, however the number zero then presents a problem and fires an exception:
image

Any help gratefully received.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions