var data = [
{ itv_seq: 1, pro_cod: 1723, pro_descr: '2016/05/25', itv_status: 1, itv_preco: 339938.5, itv_quant: 12, itv_peso: 2, itv_total: 36130.07, itv_descr: '' }
];
var consulta_data_emissao = function (ui) {
var $this = $(this);
$this.datepicker({
format: 'dd/mm/yyyy',
///language: 'pt-BR',
onClose: function (evt, ui) {
$(this).focus();
}
});
//default From date
var $from = $this.filter(".pq-from").datepicker("option", "defaultDate", new Date());
//default To date
var $to = $this.filter(".pq-to").datepicker("option", "defaultDate", new Date());
}
var obj = {
width: "100%",
flexHeight: true,
pageModel: { type: "local", rPP: 20, strRpp: "{0}", strDisplay: "{0} to {1} of {2}" },
filterModel: { on: true, mode: "AND", header: true },
freezeCols: 2,
editable: false,
showTitle: false,
collapsible: false,
numberCell: false,
colModel: [
{ title: "Filial", dataType: "integer", filter: { type: 'textbox', condition: 'begin', listeners: ['keyup'] }, width: 100, dataIndx: "itv_seq", align: "center" },
{ title: "NR Pedido", dataType: "string", filter: { type: 'textbox', condition: "between", listeners: ['keyup'] }, width: 250, dataIndx: "pro_cod", align: "center" },
{
title: "Emissão", dataType: "date",
render: function (ui) {
return $.datepicker.formatDate('dd/mm/yy', new Date(ui.cellData));
},
filter: {
type: 'textbox',
condition: "between",
init: consulta_data_emissao,
render:function( ui ){
return $.datepicker.formatDate('dd/mm/yy', new Date(ui.cellData));
},
listeners: [{ 'change': function (evt, ui) {
ui.value = $.datepicker.formatDate('dd/mm/yyyy', new Date(ui.value));
ui.value2 = $.datepicker.formatDate('dd/mm/yyyy', new Date(ui.value2));
$(this).closest(".pq-grid").pqGrid('filter', {
oper: "add",
data: [ui]
})
}
}]
},
width: 250, dataIndx: "pro_descr", align: "center"
},
{ title: "Cód Cliente", dataType: "integer", width: 200, dataIndx: "itv_status", editModel: { keyUpDown: true }, align: "center" },
{ title: "Nome Cliente", dataType: "float", format: "R$ ##.###,00", width: 150, dataIndx: "itv_preco", align: "center" },
{ title: "Total", dataType: "float", format: "##,000", width: 150, dataIndx: "itv_quant", align: "center" },
{ title: "Status Faturamento", dataType: "float", format: "##,00000", width: 150, dataIndx: "itv_peso", align: "center" },
{ title: "Status da Aprovação", dataType: "float", format: "R$ ##.###,00", width: 150, dataIndx: "itv_total", align: "center" },
{ title: "Usuario Aprovação", dataType: "string", width: 300, dataIndx: "itv_descr", align: "center" },
{ title: "Data Aprovação", dataType: "string", width: 300, dataIndx: "itv_descr", align: "center" },
{ title: "Cód. Vendedor", dataType: "string", width: 300, dataIndx: "itv_descr", align: "center" },
{ title: "Nome Vendedor", dataType: "string", width: 300, dataIndx: "itv_descr", align: "center" }
],
dataModel: { data: data }
};
$("#grid_consulta").pqGrid(obj);
There are filtering