             $( 'table tr', header ).empty().append( header_row.html() )
             header.css( 'width', header_row.width() )
 
+            # Make sure our sorting still works
+            event.data.view.detect_sort(
+                    fixed_el: header
+                    el: event.data.view.currentView.el
+                    collection: event.data.view.currentView.collection )
+
             # TODO
             # Handle click events on the fixed header so that we trigger a
             # sort.


        detect_sort: ( options ) ->

            if options.el?
                headers = $( 'th', options.el )
            else
                headers = $( 'th', @el )

            headers.click( (event) =>
                el = $( event.currentTarget )

                field = el.data( 'field' )
                order = el.data( 'order' )

                # Permutate through the ordering options for the sort.
                if not order?
                    order = 'desc'
                    $( 'i', el ).removeClass( 'icon-sort icon-sort-up' ).addClass( 'icon-sort-down' )
                else if order == 'desc'
                    order = 'asc'
                    $( 'i', el ).removeClass( 'icon-sort-down' ).addClass( 'icon-sort-up' )
                else if order == 'asc'
                    order = null
                    $( 'i', el ).removeClass( 'icon-sort-up' ).addClass( 'icon-sort' )

                el.data( 'order', order )
                @collection.sort(
                    field: field
                    order: order )
            )
            @



        initialize: ( options ) ->
            # Bind scroll event to handle the fixed-header rendering.
            $( @el ).scroll( { view: @ }, @detect_scroll )

            # Initialize the different available views.
            @rawView = new DataCollectionView( options )
