Hi!
For example, if I have this grid:
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource(Model)
.ToolbarSettings(toolBar => toolBar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.ExcelExport);
items.AddTool(ToolBarItems.WordExport);
items.AddTool(ToolBarItems.PdfExport);
}))
.AllowPaging()
.AllowFiltering()
.FilterSettings(d => d.FilterType(FilterType.FilterBar))
.IsResponsive(true)
.EnableResponsiveRow(true)
.AllowSelection(false)
.Columns(col =>
{
col.Field("UsuarioID").IsPrimaryKey(true).Add();
col.Field("Nome").HeaderText("Nome da Rota").Add();
col.Field("PrecoMercado").HeaderText("Descricao").Add();
col.Field("Tipo").HeaderText("Tipo da rota").Add();
col.Field("VigenciaInicio").Format("{0:dd/MM/yyyy}").HeaderText("Data Inicio").Add();
col.Field("VigenciaTermino").Format("{0:dd/MM/yyyy}").HeaderText("Data Termino").Add();
col.HeaderText("Opções").Commands(commands =>
{
commands.Type(UnboundType.Edit).ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties()
{
ContentType = ContentType.ImageOnly,
PrefixIcon = "e-icon e-edit",
Click = "onEditClick"
}).Add();
commands.Type(UnboundType.Delete).ButtonOptions(new Syncfusion.JavaScript.Models.ButtonProperties()
{
ContentType = ContentType.ImageOnly,
PrefixIcon = "e-icon e-delete",
Click = "onDeleteClick"
}).Add();
}).Add();
})
How I can get the columns "UsuarioID" and "PrecoMercado" in Json formatt ?
I know how to get only the primary key, on selected rows, but, now I need to get the data of all rows in the grid, ( I imagine the mechanics are exactly the same )
To get the selected rows, I use this command: "gridObj.checkSelectedRowsIndexes; "