MrJuliuss / syntara

Admin package for Laravel 4.
MIT License
302 stars 77 forks source link

Search and pagination doesn't work #172

Closed lorenc-tomasz closed 9 years ago

lorenc-tomasz commented 9 years ago
  1. Go to users management page
  2. Search some users with common name
  3. Go to next page
  4. System will reload the page and show all users instead of the ones we were searching
lorenc-tomasz commented 9 years ago
  1. Go to users management page
  2. Go to page 2
  3. Search for something
  4. You will see results and then page will be refreshed and you will see all results on page 1
lorenc-tomasz commented 9 years ago

My solution (base.js):

var ajaxContent = function(url, content, options, useSave)
{
    if(lastAjxOpt != null && useSave === true)
    {
        options = lastAjxOpt;
        lastAjxOpt = null;
    }

    $.ajax(
    {
        url: url,
        type: "GET",
        datatype: "html",
        data: options
    })
    .done(function(data)
    {
        $(content).empty().html(data.html);
        if(typeof url !== "undefined" && url != window.location)
        {
           // window.location.replace(url);
           // window.history.pushState(data, '', window.location);
            window.history.pushState(data, '', this.url);
        }

        lastAjxOpt = options;
    });
};
MrJuliuss commented 9 years ago

Hi, i will watch it ;) (sorry for late)

Edit : fixed https://github.com/MrJuliuss/syntara/commit/c0c60ac4ddb9ad4120bda140e30c6c9ddf9a847c