                 no_results: @metadata.has_more_data isnt true and @results.length is 0 and @metadata.skip_value is 0
                 num_results: ((@metadata.skip_value+@results.length) if @metadata.has_more_data isnt true)
 
-            switch @prototype.view
+            switch @view
                 when 'tree'
                     @.$('.json_tree_container').html @json_to_tree @results
                     @$('.results').hide()


        show_tree: (event) =>
            event.preventDefault()
            @prototype.view = 'tree'
            @render_result()
        show_table: (event) =>
            event.preventDefault()
            @prototype.view = 'table'
            @render_result()
        show_raw: (event) =>
            event.preventDefault()
            @prototype.view = 'raw'
            @render_result()

        render_error: (query, err) =>

                        cursor: null
                        metadata: null
                        cursor_timed_out: true
                        view: 'tree'
            # Else the user created a data explorer view before

            # Load history, keep it in memory for the session
