A table with custom functionality. Can be used either with an explicit custom header row for more flexibility or without.
This makes the table a ShareItGrid. If not set then all functionality for this and child tags will be ignored. This is a required field.
The ShareItGrid helper class object to be passed to the grid which contains the data model in it. This is a required field.
The property name used to post back to the edit action for the primary key id field.
The property name used to post back to the delete action to designate if this is "delete" or "undelete".
The confirmation text displayed when deleting.
The confirmation text displayed when undeleting.
The action to call when Add or Edit button is pressed.
Show an Add button. Only used if no explicit header row supplied.
The action to call when Add button is pressed. Overrides the Action property only for Add. Only used if no explicit header row supplied.
An id to add to the Add button. Only used if no explicit header row supplied.
Show the count in the footer.
Separate the paging and count lines.
Hide the paging controls until there is more than 1 page.
Makes the top header row sticky for when using long row numbers.
Change the default height of the grid when using sticky headers.
Inserts an "Add" icon into this header field before any child content.
The action URL to post back to when pressing the Add button.
If exists then use this primary key Id for the new entry. If null then automatically create one.
Child of <th>. Sort this column by clicking on the contents of this tag.
The data source field name to sort.
Which direction to sort by. If null then start with Ascending.
Show the sorted direction icon.
public enum Directions { Asc, Desc, None }
If exists then use this primary key Id for edits and deletes on this row. This can be overridden by child objects.
Inserts a "Delete" icon into this field before any child content.
The action URL to post back to when pressing the Delete or Undelete button.
If exists then use this primary key Id for the delete or undelete. If null then use the RowId in the <tr> tag.
Is this record currently active or deleted. Used to determine which icon to render.
The text to put in the column header. Only used if no explicit header row supplied
The fieldname to use when sorting by this column. Only used if no explicit header row supplied
Child of <td>. Edit this row by clicking on the contents of this tag.
If exists then use this primary key Id for the edit. If null then use the RowId in the <tr> tag.
The action URL to post back to when pressing the Edit button. Overrides the Action property only for Edit.
This helper class holds the data model and enacts sorting and paging.
The Id string value of the <table> tag.
The HttpContext to pass to the control.
Does this grid allow paging.
Number of rows per page.
The number of page number links to display in the footer at a time for each "page number page".
Shows an Add button somewhere on the page that acts as an Add button for the specified grid.
The text to display on the button.
The Id of the grid to act on behalf of.
CSS class to add to the button.
Loads a table via ajax and all paging and sorting operations.
The url for rendering the grid.
A comma separated list of control ids to use in the POST request.
The id of a filter to use to filter this grid. This prevents other filters intended for other grids on the same page from acting on this grid.
A list of Extra Parameters to pass to the child grid.
Make the child grid read only.
Do not automatically populate the grid. This is used to allow another event or javascript to call ShareItLibrary.ShareItGrid.AjaxLoad(gridId) when ready to load the grid.
Provide a reference to the child grid. If this exists then sorting and paging will be kept across HTML page refreshes for the child grid.
The location of the waiting gif for when the grid is refreshing.
Tiggered when an Ajax grid is loaded. For Ajax grid use the parent Ajax grid id. $('#Grid').on('loaded', Function)
Tiggered when a delete or undelete button is pressed in the grid. For Ajax grid use the parent Ajax grid id. $('#Grid').on('delete', Function)
A comma separated list of control ids to use in the POST request.
Loads or reloads the grid with the id gridId.
Selects all items on the grid and stores their values in the indexedDb. $('#MyGrid').SiGridSelectAll();
Returns all selected values on a grid that are stored in indexedDb. var x = $('#MyGrid').SiGridCacheValues();
Clears the passed selected values on a grid that are stored in indexedDb. $('#MyGrid').SiGridFieldCacheRemoveAsync(rowIds);
Clears all selected values on a grid that are stored in indexedDb. $('#MyGrid').SiGridClearFieldCacheValues();
Refreshes a grid. $('#MyGrid').SiGridAjaxLoad();
@model ShareItGrid<table shareit-grid="true" id="MyGrid" share-it-grid-model="@Model"> @{ var data = Model.ModelGet<MyModel>(); } <tbody> @foreach (var m in data) { <tr row-id="@m.Id"> <td header-text="Name Field" header-sort-field="Name"><edit>@m.Name</edit></td> <td header-text="Description">@m.Description</td> <td header-text="Note">@m.Note</td> <td delete-button="true" delete-action="Delete" active="@m.Active"></td> </tr> } </tbody></table>@model ShareItGrid<table shareit-grid="true" id="MyGrid" share-it-grid-model="@Model"> @{ var data = Model.ModelGet<MyModel>(); } <tbody> @foreach (var m in data) { <tr row-id="@m.Id"> <td header-text="Name Field" header-sort-field="Name"><edit>@m.Name</edit></td> <td header-text="Description">@m.Description</td> <td header-text="Note">@m.Note</td> <td delete-button="true" delete-action="Delete" active="@m.Active"></td> </tr> } <tr> <td>Not data driven row</td> <td>Last row</td> <td></td> <td></td> </tr> </tbody> <tfoot> <tr> <td>Count:</td> <td>@data.Count()</td> <td></td> <td></td> </tr> </tfoot></table>@model ShareItGrid<table shareit-grid="true" id="MyGrid" share-it-grid-model="@Model"> <thead> <tr> <th><sort field="Name">Name</sort></th> <th>Description</th> <th>Note</th> <th add-button="true"></th> </tr> </thead> @{ var data = Model.ModelGet<MyModel>(); } <tbody> @foreach (var m in data) { <tr row-id="@m.Id"> <td><edit>@m.Name</edit></td> <td>@m.Description</td> <td>@m.Note</td> <td delete-button="true" delete-action="Delete" active="@m.Active"></td> </tr> } <tr> <td>Not data driven row</td> <td>Last row</td> <td></td> <td></td> </tr> </tbody> <tfoot> <tr> <td>Count:</td> <td>@data.Count()</td> <td></td> <td></td> </tr> </tfoot></table>var myData = ... Get IQueryable Data Sourcevar sig = new ShareItGrid("MyGrid", HttpContext){ PageSize = 100, PageNumsPageSize = 20};sig.Process(myData); return View(sig);@model ShareItGrid<table shareit-grid="true" id="MyGrid" share-it-grid-model="@Model"> @{ var data = Model.ModelGet<MyModel>(); } <tbody> @foreach (var m in data) { <tr row-id="@m.Id"> <td><edit>@m.Name</edit></td> <td>@m.Description</td> <td>@m.Note</td> <td delete-button="true" delete-action="Delete" active="@m.Active"></td> </tr> } </tbody></table><table-ajax-grid id="MyGridGrid" share-it-grid-ajax-url="/Controller/MyGridGrid" control-ids="MyId"></table-ajax-grid>[HttpPost]public IActionResult MyGrid(Guid myId){ var sig = new ShareItGrid("MyGrid", HttpContext, db.MyTable.Where(e => e.MyId == myId).OrderBy(e => e.MySortField)); return PartialView(data);}