jsGrid2Mvc 1.0.0.2621

dotnet add package jsGrid2Mvc --version 1.0.0.2621
                    
NuGet\Install-Package jsGrid2Mvc -Version 1.0.0.2621
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="jsGrid2Mvc" Version="1.0.0.2621" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="jsGrid2Mvc" Version="1.0.0.2621" />
                    
Directory.Packages.props
<PackageReference Include="jsGrid2Mvc" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add jsGrid2Mvc --version 1.0.0.2621
                    
#r "nuget: jsGrid2Mvc, 1.0.0.2621"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package jsGrid2Mvc@1.0.0.2621
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=jsGrid2Mvc&version=1.0.0.2621
                    
Install as a Cake Addin
#tool nuget:?package=jsGrid2Mvc&version=1.0.0.2621
                    
Install as a Cake Tool

jsGrid2Mvc

jsGrid2Mvc is a library that provides to you a MVC wrapper for jsGrid, in order to generate html and Js from a model in a easy and consistent way. The key component of the library are:

  • Grid.cs: class tha contains the Grid model itself, that translate in Object-Oriented language the fileds and features provided by jsGrid library
  • MvcGrid.cs: class that simplify the geenration of Javascript code on page
  • GridExtensions.cs: class to extend and manage the model in a user friendly mode

you can install the library from nuget using the command:

dotnet add package jsGrid2Mvc

Status

Build Status

Bugs Vulnerabilities Security Rating

Requirements

To use jsGrid2Mvc you have to install in you web application:

  • Bootstap > 5.2: see XXXXXX
  • jquert > : see XXXXX
  • jsGrid: see XXXXX

How to Configure

First of all you have to set the default configuration of the grid in your application. Add to appSettings.json file this section:

{
"UI": {
    "Grid": {
      "Width": "100%",
      "Height": "auto",
      "FilteringEnabled": true,
      "SearchEnabled": true,
      "SortingEnabled": true,
      "PagingEnabled": true,
      "Pagination": {
        "PageIndex": 1,
        "PageSize": 20,
        "ButtonCount": 15,
        "Pages": "{first} {prev} {pages} {next} {last}    {pageIndex} of {pageCount}",
        "PrevText": "Prev",
        "NextText": "Next",
        "FirstText": "First",
        "LastText": "Last",
        "NavigatorNextText": "...",
        "NavigatorPrevText": "..."
      },
      "ConfirmOnDelete": true,
      "ConfirmOnDeleteMessage": "Are you sure to delete current item?"
    }
  }
}

for the options, you can see GridSettings.cs file or see the Samples application. Then, on your MVC model, you can create the grid:

var grid = new Grid("testGrid", "Grid to show how to interact with controller").FromConfiguration(config);

and you can customize it as you need:

grid.SetReadOnlyWithSerializedData("[\r\n        { \"Name\": \"Otto Clay\", \"Age\": 25, \"Country\": 1, \"Address\": \"Ap #897-1459 Quam Avenue\", \"Married\": false },\r\n        { \"Name\": \"Connor Johnston\", \"Age\": 45, \"Country\": 2, \"Address\": \"Ap #370-4647 Dis Av.\", \"Married\": true },\r\n        { \"Name\": \"Lacey Hess\", \"Age\": 29, \"Country\": 3, \"Address\": \"Ap #365-8835 Integer St.\", \"Married\": false },\r\n        { \"Name\": \"Timothy Henson\", \"Age\": 56, \"Country\": 1, \"Address\": \"911-5143 Luctus Ave\", \"Married\": true },\r\n        { \"Name\": \"Ramona Benton\", \"Age\": 32, \"Country\": 3, \"Address\": \"Ap #614-689 Vehicula Street\", \"Married\": false }\r\n    ]")
    .UseReferencedCollection("testGrid_countries", "[\r\n        { Name: \"\", Id: 0 },\r\n        { Name: \"United States\", Id: 1 },\r\n        { Name: \"Canada\", Id: 2 },\r\n        { Name: \"United Kingdom\", Id: 3 }\r\n    ]")
        .AddColumn(new Column("Name", "150").AsText().Required().Sortable())
        .AddColumn(new Column("Age", "50").AsNumber().Sortable().NotSearchable())
        .AddColumn(new Column("Address", "200").AsText().Sortable())
        .AddColumn(new Column("Country", "200").AsSelect("testGrid_countries", "Id", "Name").Sortable())
        .AddColumn(new Column("Married", "50", title: "Is Married").AsCheckBox())
        .AddColumn(new Column("control", "150", title: "Actions").AsControl());

How to injects required component into DI

to register services and components to use this library, you have to use needed extensions method:

builder.Services.AddCommonGridViewSettings(builder.Configuration);
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.2621 416 5/5/2023