-1
I need a javascript function that brings the data filled in gridview
and put in a lista
, searching found the following function:
function pegarDadosGrid(e) {
var dados = e.component.getDataSource().items();
$("input[name='myHiddenInput']").val(JSON.stringify(items));
}
But I can’t tell if it’s working, there’s no way to put break point
How can I take data from a grid and put it into one variável
using javascript
My grid:
<div class="divGrid">
@(Html.DevExtreme().DataGrid<ContatosViewModel>().ID("gridContainer")
.ColumnAutoWidth(true)
.Height(200)
.Width(758)
.ShowBorders(true)
.Paging(paging => paging.Enabled(false))
.Editing(editing =>
{
editing.Mode(DevExtreme.AspNet.Mvc.GridEditMode.Row);
editing.AllowAdding(true);
editing.AllowDeleting(true);
editing.AllowUpdating(true);
})
.Columns(columns =>
{
columns.AddFor(m => m.Con_nome);
columns.AddFor(m => m.Con_vinculo);
columns.AddFor(m => m.Con_fone);
columns.AddFor(m => m.Con_fax);
columns.AddFor(m => m.Con_celular);
columns.AddFor(m => m.Con_email);
}).DataSource(AgenciaController.ListaContatos)
.OnContentReady("pegarDadosGrid")
)
</div>
Thank you very much, it’s working, vllww
– Jeff Henrique