       attrs.page = @$.pagination.page
     if @search && @$.search
       attrs.search = @$.search
+    if @$.sortable
+      attrs.sort   = @$location.search().sort
+    if @$.pagination
+      if @$.pagination.page is 1
+        @$location.search 'page', null
+      else
+        @$location.search 'page', @$.pagination.page
     @Api[@table_name][@action] attrs
   destroy:(model)=>
     name = _.singularize @table_name

        edit: if @Event[name] && @Event[name].edit then @Event[name].edit else @Event.template(name,'edit')
    if @search is 'location'
      search = @$location.search()
      @$.search = search.search if search.search
    @reindex() if @pull
    @$.$watch 'search', _.debounce(@update_search, 500) if @search
    @index_success null, @data() if @data
    @$.destroy = @destroy
    @reindex = _.debounce @reindex, 100
  update_search:(val,old)=>
    if old != val
      if @search is 'location'

          @$location.search 'search', null
      if @$.pagination
        @$.pagination.page = 1
        @$location.search 'page', null
      @reindex() if @pull
  reindex:=>
    attrs = @attrs()
