jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Nested multiple Grid
Tagged: angular grid, angular2 grid, bootstrap grid, javascript grid, jquery grid, jqwidgets grid, jqxgrid, typescript grid
This topic contains 1 reply, has 2 voices, and was last updated by Hristo 8 years, 4 months ago.
-
AuthorNested multiple Grid Posts
-
Good morning people,
I was left with one doubt yet. My Grid is working with a JSON format, coming from a php query through a $ .POST ajaxMy example:
$.ajax({
type: “POST”,
data: {p0: ops, p1: codi, p2: tipo, p3: varb, p4: usua},
url: “auxcomercial.php”,
datatype: “html”,
async: false,
success: function (result) {
data = result;
},
error: function () {
data = ”;
atoast(event, ‘warning’, ‘Ops! Recarregue a pagina, algo saiu errado!’);
}
});var source = {
localdata: data,
datatype: “json”,
datafields: [
{name: ‘matricula’, type: ‘string’},
{name: ‘nome’, type: ‘string’},
{name: ‘cpf’, type: ‘string’},
{name: ‘rg’, type: ‘string’},
{name: ‘sus’, type: ‘string’},
{name: ‘nasc’, type: ‘date’},
{name: ‘tipo’, type: ‘string’},
{name: ‘pai’, type: ‘string’},
{name: ‘mae’, type: ‘string’},
{name: ‘ecivil’, type: ‘string’},
{name: ‘sexo’, type: ‘string’},
{name: ‘nuf’, type: ‘string’},
{name: ‘ncidade’, type: ‘string’},
{name: ‘orgao’, type: ‘string’}
]
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#Bgrid”).jqxGrid({
width: ‘100%’,
source: dataAdapter,
sortable: true,
filterable: true,
autoshowfiltericon: true,
columnsresize: true,
scrollmode: ‘deferred’,
deferreddatafields: [‘nome’, ‘matricula’],
theme: ‘energyblue’,
pageable: true,
localization: getLocalization(),
columns: [
{text: ‘Matricula’, datafield: ‘matricula’, width: 150},
{text: ‘Nome’, datafield: ‘nome’, width: 200, filtertype: ‘checkedlist’},
{text: ‘CPF’, datafield: ‘cpf’, width: 120},
{text: ‘RG’, datafield: ‘rg’, width: 100, cellsalign: ‘right’},
{text: ‘Nascimento’, datafield: ‘nasc’, width: 90, cellsalign: ‘right’, cellsformat: ‘d’},
{text: ‘SUS’, datafield: ‘sus’, cellsalign: ‘right’},
{text: ‘Tipo’, datafield: ‘tipo’}
]
});I wanted to do with this my example, the same example from this link: https://www.jseditor.io/?key=multiple-nested-grids-in-tabs
But I want to do with the json format. How I do?
Hello Francisco,
I am not sure I understand you.
If you want to create a similar or same example as you mentioned – please, take a look this particular example in details.
To use JSON data instead of XML – need to change the DataAdapter and to changedatatype: "json"
also.
Also, I suppose the shared code is basic and will add other options (asrowdetails
,rowdetailstemplate
,initrowdetails
and etc)Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.