I need do multiple sorting, but the jqgrid not show me the icons of the sort direction for each column. What is wrong in this code?
jQuery(document).ready(function() {
$(“#grid”).jqGrid(
{
datatype: function() {
$.ajax(
{
url: “OrdenDeProduccion.aspx/GetOrdenDeProduccion”, //PageMethod
data: “{'pPageSize':'” + $('#grid').getGridParam(“rowNum”) +
“','pCurrentPage':'” + $('#grid').getGridParam(“page”) +
“','pSortColumn':'” + $('#grid').getGridParam(“sortname”) +
“','pSortOrder':'” + $('#grid').getGridParam(“sortorder”) + “'}”, //PageMethod Parametros de entrada
dataType: “json”,
type: “post”,
contentType: “application/json; charset=utf-8”,
complete: function(jsondata, stat) {
if (stat == “success”)
jQuery(“#grid”)[0].addJSONData(JSON.parse(jsondata.responseText).d);
else
alert(“Error al traer los datos desde json”);
}
});
},
jsonReader: //Set the jsonReader to the JQGridJSonResponse squema to bind the data.
{
root: “Items”,
page: “CurrentPage”,
total: “PageCount”,
records: “RecordCount”,
repeatitems: true,
cell: “Row”,
id: “Id”
},
colModel: //Columns
[
{ index: 'Id', name: 'Id', width: 10, align: 'Left', label: 'Id', hidden: true },
{ index: 'Horaentrada', name: 'Horaentrada', align: 'Center', label: 'Hora', width: 200, sortable: false },
{ index: 'Producto', name: 'Producto', align: 'Center', label: 'Producto', width:200 },
{ index: 'Cantidad', name: 'Cantidad', align: 'Center', label: 'Cantidad', width: 200, sorttype: 'int' },
{ index: 'Precio', name: 'Precio', align: 'Center', label: 'Precio', width: 200, sorttype: 'float' },
],
caption: “Tabla Orden de Produccion”,
loadtext: 'Cargando datos…',
emptyrecords: 'No hay resultados',
rowNum: 10, // PageSize.
rownumbers: true,
rownumWidth: 40,
gridview: true,
pager: “#pager”, //Pager
viewrecords: true,
//sortname: “Cantidad”,
sortorder: “asc”, //Default SortOrder.
viewsortcols: true,
width: “760”,
height: “260”
}).navGrid(“#pager”, “#grid”, { edit: false, add: false, search: true, del: false });
});
Thanks,
Regards!
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top