|
1. In which scenario you want to update pageSize in Grid?
- I want to update page size on document ready, so the grid will contain appropriate row count based on remaining grid height divided (:) row height
2. In grid row height will be same for all the rows. So, please tell me you have enabled allowTextWrap property or any other properties in Grid?
- To make sure the row height are the same, i enabled allowTextWrap but only for header which will not affect content
3. Grid rendering code example both client and server.
> Razor:
@Html.EJ().DataManager("MyGridDM").URL(Url.Action("ItemRead")).RemoveURL(Url.Action("ItemDelete")).Adaptor(AdaptorType.UrlAdaptor)
@Html.EJ().Grid<T>("MyGrid")
.Locale("id-ID")
.DataManagerID("MyGridDM").CssClass("no-border")
.ShowColumnChooser()
.GridLines(Syncfusion.JavaScript.GridLines.Horizontal)
.EnableHeaderHover(false).EnableTouch(true)
.AllowSelection(true).SelectionSettings(s => s.SelectionMode(m => m.AddMode(Syncfusion.JavaScript.SelectionMode.Row))).SelectionType(Syncfusion.JavaScript.SelectionType.Multiple)
.AllowSearching(true)
.AllowTextWrap(true).TextWrapSettings(t => t.WrapMode(Syncfusion.JavaScript.WrapMode.Header)) //only header
.AllowPaging(true).PageSettings(page => { page.PageSize(15); page.PrintMode(Syncfusion.JavaScript.PrintMode.CurrentPage); })
.AllowFiltering(false).FilterSettings(d => d.FilterType(Syncfusion.JavaScript.FilterType.Menu))
.AllowSorting(true).AllowMultiSorting()
.AllowGrouping(false).GroupSettings(group => { group.EnableDropAreaAutoSizing(true); })
.AllowResizing(true).ResizeSettings(rz => rz.ResizeMode(Syncfusion.JavaScript.ResizeMode.Normal))
.AllowReordering(false)
.ContextMenuSettings(contextMenu => { contextMenu.EnableContextMenu(false); })
.MinWidth(350)
.IsResponsive(true).AllowScrolling(true).ScrollSettings(s => s.Height("auto"))
.EditSettings(e => {
e.AllowAdding(true).ShowConfirmDialog(false)
.AllowEditing(true).EditMode(Syncfusion.JavaScript.EditMode.Normal).AllowEditOnDblClick(false)
.AllowDeleting(true).ShowDeleteConfirmDialog(true);
})
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar(false);
}).Column(col => { ... })
> Javascript:
$(function () {
var calcHeight = 300, pageSize = 10;
//do some calculation such as getting document height minus all grid's content parent & sibling element height (exclude grid content)
// calcHeight = ...
//apply calculated height to grid
$('#MyGrid .e-gridcontent').height(calcHeight);
//calculate pageSize
pageSize = calcHeight / $('#SFGridItem').ejGrid('getRowHeight');
//apply calculated pageSize to grid
$('#SFGridItem').ejGrid('option', 'pageSettings.pageSize', pageSize); // -> trigger second data request,
//first data request already done automaticly because of data manager's UrlAdaptor behavior *this is the one that i want to prevent to save bandwidth*
}
4. Share the video or screenshot to show the issue
Dunno how to make one vid, can't really described by a screenshot, but i hope you get my intention
5. Essential studio and browser details.
6. Share your expected output image.
- My expected output is to prevent the first default data request (see bold text above), so no image related
Other question left:
2. When i want to print grid content, saving change confirm dialog always get called (the grid is not in editing mode), i found that this behavior only happen if property [showDeleteConfirmDialog] is set to true.
Is this behavior as expected?
3. I found a bug (at least to me) if grid property: [enableTouch] is set to false, while using column type checkbox (for multiselect), the header checkbox is misbehaving when clicked. It behave the opposite way it suppose to be
Up thread