joeharrison714 / MVCGrid.Net

http://mvcgrid.net
MIT License
75 stars 56 forks source link

Paging does not work #174

Open fmblas opened 5 years ago

fmblas commented 5 years ago

I have installed the NuGet MVCGrid.net package First I could not find “~/MVCGridHandler.axd /script.js” I downloaded the sources and copied MVCGrid.js into a folder When paging in IE11 it does not do anything When paging in Chrome gives the Bad Request error Make a call to %%HANDLERPATH%%?page=2&Name=CuadrosMando&_=1532070970455 In MVCGrid.js in this line (var showErrorDetails = '%%ERRORDETAILS%%';) %%ERRORDETAILS%% it came without quotes and it gave a javascript error

The code of the page I wrote it as in the example

` gb.GridDefinition.RetrieveData = (options) => { FiltroCuadrosMando filtro = null; QueryOptions qo = options.QueryOptions;

            if (qo.Filters.Count == 0)
            {
                filtro = new FiltroCuadrosMando();
            }
            else
            {
                filtro = new FiltroCuadrosMando(qo.GetFilterString("Descripcion"),
                                                Tools.StrToDateTime(qo.GetFilterString("DesdeIniVigencia")),
                                                Tools.StrToDateTime(qo.GetFilterString("HastaIniVigencia")));
            }

            entorno.Connection.Open();

            adCuadrosMando adCuad = new adCuadrosMando(entorno.Connection);

            QueryResult<CuadroMando> qr = new QueryResult<CuadroMando>();

            var resul = adCuad.GetCuadrosMando(filtro).AsQueryable();

            qr.TotalRecords = resul.Count();

            if (options.QueryOptions.GetLimitOffset().HasValue)
            {
                resul = resul.Skip(options.QueryOptions.GetLimitOffset().Value).Take(options.QueryOptions.GetLimitRowcount().Value);
            }
            qr.Items = resul;

            entorno.Connection.Close();

            return qr;
        };

`