Skip to content

pabitrosingh/JQGridExtensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JQGridExtensions

JQGrid Extensions for Server Side Searching / Sorting

Landing Page of JQGrid

JQGrid

Technology Used

I have used open source Technologies / Framework for this projects

Setup

this repo contains two projects in the folders

JQGridDemo

This Folder contains Domo app

JQGridExtensions-DLL

This Folder contains DLL JQGrdExtensions.dll that is used in Demo app DLL File

Sorting / Searching:

public JsonResult GetEmployeeCollection(JQGridSettings JQGrid)
{
    int TotapPages = 0;
    int TotalRecords = 0;
    IEnumerable<Employee> IEEmployee = null;
    IQueryable<Employee> IQEmployee = null;

    using (Employee DB = new Employee())
    {
        if (JQGrid._search)
        {
            //for Filter Toolbar 
            JQGridFilters _filters = JsonConvert.DeserializeObject<JQGridFilters>(JQGrid.filters);
            IQEmployee = DB.GetEmployeeColection().AsQueryable().JQGridToolBarSearch(_filters);

            //for Advanced Search
            //JQGridAdvanceFilter _filters1 = JsonConvert.DeserializeObject<JQGridAdvanceFilter>(JQGrid.filters);
            //IQEmployee = DB.GetEmployeeColection().AsQueryable().JQGridAdvancedSearch(_filters1);
        }
        else
        {
            IQEmployee = DB.GetEmployeeColection().AsQueryable().JQGridSorting(JQGrid.sidx, JQGrid.sord);
        }
        IEEmployee = IQEmployee.AsEnumerable();
        try
        {
            //Pagination
            TotapPages = Convert.ToInt32(Math.Ceiling((double)IEEmployee.Count() / (double)JQGrid.rows));
            TotalRecords = IEEmployee.Count();
            IEEmployee = IEEmployee.Skip((JQGrid.page - 1) * JQGrid.rows).Take(JQGrid.rows).ToList();
        }
        catch (Exception )
        {
            throw;
        }
    }
    var jsonReader = new
    {
        root = IEEmployee,
        page = JQGrid.page,
        total = TotapPages,
        records = TotalRecords
    };
    return Json(jsonReader, JsonRequestBehavior.AllowGet);
}

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

JQGrid Extensions for Server Side Searching / Sorting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published