Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mac

Pages: [1]
1
Help for ParamQuery Pro / Re: Date format
« on: May 26, 2014, 12:40:27 pm »
Ok, thanks a lot, now filter does the work that I want.

Maybe in the future you can implement this on pqgrid, can be very useful for people that's not using mm/dd/yy format :D

For change the date I splited the date like this:

Code: [Select]
var d1 = ui.value.split('/');
var d2 = ui.value2.split('/');
ui.value = d1[1]+'/'+d1[0]+'/'+d1[2];
ui.value2 = d2[1]+'/'+d2[0]+'/'+d2[2];

2
Help for ParamQuery Pro / Re: Date format
« on: May 23, 2014, 04:40:22 pm »
I mean by filter format, the dataFormat on datapicker, was my mistake.

I know that datepicker editor has no relation to the filtering, but if I want to display the same dateFormat on the filter input I can't.

I have this colModel, I keep the date in mm/dd/yyyy format in the data:
Code: [Select]
{ title: "Fecha de carga", width: 200, dataType: "date", resizable:true,
render:function( ui ){
return $.datepicker.formatDate('dd/mm/yy', new Date(ui.cellData));
}




Example images:

Image1: the data on the grid.



Image2: filtered data. With dateFormat default on datepicker.



Image3: no rows with dateFormat:'dd/mm/yy' on datepicker.


3
Help for ParamQuery Pro / Re: Date format
« on: May 23, 2014, 01:37:02 pm »
Well, that works to recover data date in mm/dd/yy format and if I don't change the filter format it works too.

But filtering does not work if the date is on this format: dd/mm/yyyy.

Okay, let's see a example code, this is my DatePicker, if I don't change the format (commented line) it works but when I use dd/mm/yyyy format filter doesn't work.

I want to display in filter the same format that on the row.

Code: [Select]
function pqDatePicker(ui) {
        var $this = $(this);
        $this
            .css({ zIndex: 3, position: "relative" })
            .datepicker({
                changeYear: true,
                changeMonth: true,
//dateFormat: "yy-mm-dd",
                onClose: function (evt, ui) {
                    $(this).focus();
                }
            });
    }

4
Help for ParamQuery Pro / Date format
« on: May 23, 2014, 12:00:47 pm »
Hello,

There any method to change the format of the data in the grid?

The problem is that I had to filter and show the date with dd/mm/yy format.

Thanks

5
Bug Report / Re: Filter from another gird
« on: May 22, 2014, 12:56:39 pm »
Here you have an example, I'm reproducing the issue with that code. If you need somthing tell me.

Thanks.

Code: [Select]
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<!--jQuery dependencies-->
<link href="css/south-street/jquery-ui-1.10.4.custom.css" rel="stylesheet">
<script src="js/jquery-1.10.2.js"></script>
<script src="js/jquery-ui-1.10.4.custom.js"></script>
<!--PQ Grid files-->
    <link rel="stylesheet" href="pqgrid.min.css" />
    <script src="pqgrid.min.js"></script>
<script src="js/jquery.vbuton.js"></script>
<!--PQ Grid Office theme-->
<script src="js/jquery.ui.touch-punch.js"></script>

</head>
<body>

<div id="grid_table1"></div>


<table class="StockTable" id="StockTable">
<tbody><tr valign="middle" id="header">
<th class="lineNum">lineNum</th>
<th class="familia">Familia</th>
<th class="variedad">Variedad</th>
</tr><tr id="Tr1" class="rowcolor1"><td class="lineNum">5</td>
<td class="familia">CEREZA</td><td class="variedad">EARLY BIGI</td>
</tr><tr id="Tr1" class="rowcolor1"><td class="lineNum">6</td><td class="familia">CEREZA</td>
<td class="variedad">EARLY BIGI</td></tr><tr id="Tr1" class="rowcolor1"><td class="lineNum">7</td>
<td class="familia">MANZANA</td><td class="variedad">CRIPPS PINK</td>
</tr><tr id="Tr1" class="rowcolor1"><td class="lineNum">8</td><td class="familia">MANZANA</td>
<td class="variedad">CRIPPS PINK</td></tr><tr id="Tr1" class="rowcolor1"><td class="lineNum">9</td>
<td class="familia">MANZANA</td><td class="variedad">CRIPPS PINK</td></tr><tr id="Tr1" class="rowcolor1">
<td class="lineNum">10</td><td class="familia">ALBARICOQUE</td><td class="variedad">2084-14</td>
</tr><!-- repeating rows end -->
</tbody></table>   

<script>

$(function () { //Stock1

var tbl = $("table.StockTable");
var obj = $.paramquery.tableToArray(tbl);


var newObj = { width: 500,
height:500,
title:"Stock",
resizable:true,
draggable:true,
groupModel:{
            dataIndx: [1],               
            collapsed: [ false],
            title: ["<b style='font-weight:bold;'>{0} ({1} palets)</b>"],
            dir: ["up"]
            //,icon: ["circle-plus", "circle-triangle", "triangle"]
        },
filterModel: { on: true, mode: 'AND', header: true, type: 'local' },
editModel: { clicksToEdit: 0, saveKey: 13 },
scrollModel:{theme:true},
selectionModel: { type: 'cell', mode: 'block'},
hoverMode:'cell',
numberCell:{resizable:true,title:"#",width:30,minWidth:30},

//selectionModel:{type: 'cell',mode:'block'},

};

newObj.colModel = [{ title: "lineNum", hidden: true, dataType: "integer"},

    { title: "Variedad", width: 250, dataType: "string", resizable:true, filter: { type: 'textbox', condition: 'contain', listeners: ['keyup'] },
render:function( ui ){
//console.log(ui.rowData[14]);
if (ui.rowData[14]=='1'){
$grid.pqGrid( "addClass", {rowIndx: ui.rowData.rowIndx, cls: 'glow'} );
}
return ui.rowData[ui.dataIndx];
}},
{ title: "Familia", dataType: "string"},

];
//$("#grid_table1").pqGrid(newObj);
console.log(obj.data);
newObj.dataModel = {         location: "local",
        sorting: "local",
        sortDir: "up",
data: obj.data
};

newObj.changeTable = function (data){
console.log(this);
}
var $grid = $("#grid_table1").pqGrid(newObj);

$grid.pqGrid("filter", { oper: 'add', data: [] })
.pqGrid("refresh");

});


</script>
</body>
</html>

6
Bug Report / Re: Filter from another gird
« on: May 21, 2014, 08:44:02 pm »
Hello,

I have another question.

When I filter a item that's in the grid it works, but when I filter some item that isn't in the grid it shows the last coincidence and is not showing No rows to display.

Example:
I look for APPLES and in the grid I have: APPLES, MELONS, and APPLES.
It shows 2 apples, it's fine.
I look for ORANGES and it shows 2 apples and the melons, should display: No rows to display.

Ah, when I click some of the rows bad filtered it raises a exception:
Quote
Uncaught TypeError: Cannot read property '1' of undefined pqgrid.min.js:9
g._onClickCell pqgrid.min.js:9
(anonymous function) jquery-ui-1.10.4.custom.js:401
(anonymous function) pqgrid.min.js:9
jQuery.event.dispatch jquery-1.10.2.js:5095
elemData.handle jquery-1.10.2.js:4767


7
Bug Report / Re: Filter from another gird
« on: May 19, 2014, 07:01:04 pm »
Thanks a lot, it works. I'm local filtering with location == 'remote', and used filter method.

Didn't know that you can add type in filterModel, this isn't in documentation API or it is?

8
Bug Report / Re: Filter from another gird
« on: May 19, 2014, 01:27:13 pm »
I have the 2nd grid remotely.
I've seen another posts and I've implemented filter localy, and it works the first time, but if I change the filter (click on another row with a diferent name) it doesn't work, continue showing the first filtered items. Maybe because the first have all the items, and when I put the next filter it only have the items of the first filter?  What I have to do for the local filter work?

1st grid, I get the value of the row value that I want to filter, and set the filter on 2nd grid:
Code: [Select]
    newObj.rowClick = function (evt, obj) {

var dataCell = obj.rowData;
var $gridStock=$( "#grid_table" ).pqGrid();
$gridStock.pqGrid( "option", "dataModel.location", "local" );
//alert(dataCell[2]);
var filterObject =
{
on:true,
condition: 'contain',
value: dataCell[2]
};
var colM=$gridStock.pqGrid( "option", "colModel" );
//set filter of 1st column
colM[2].filter = filterObject;

$gridStock.pqGrid( "option", "colModel", colM );
var filterModel=$gridStock.pqGrid( "option", "filterModel" ); 
console.log(colM[2],filterModel);
$gridStock.pqGrid("refreshDataAndView");

$gridStock.pqGrid( "option", "dataModel.location", "remote" );
}



9
Bug Report / Filter from another gird
« on: May 16, 2014, 02:34:56 pm »
Hi,

I have 2 grids and I want to filter de 2nd grid with a value from the 1st, but the filter doesn't work.



1st grid, I get the value of the row value that I want to filter, and set the filter on 2nd grid:
Code: [Select]
    newObj.rowClick = function (evt, obj) {
var dataCell = obj.rowData;
var $gridStock=$( "#grid_table" ).pqGrid();
//alert(dataCell[2]);
var filterObject =
{
on:true,
condition: 'contain',
value: dataCell[2]
};
var colM=$gridStock.pqGrid( "option", "colModel" );
//set filter of 1st column
colM[2].filter = filterObject;
$gridStock.pqGrid("refreshDataAndView");
$gridStock.pqGrid( "option", "colModel", colM );
//var filterModel=$gridStock.pqGrid( "option", "filterModel" ); 
//console.log(colM[2],filterModel);
}

And this is the inizialization of filterModel on 2nd grid:

Code: [Select]
var newObj = {
filterModel: { mode : "AND" },
},


Log returns

Quote
>var $gridStock=$( "#grid_table" ).pqGrid();
>var filterModel=$gridStock.pqGrid( "option", "filterModel" );
>filterModel
Object {on: true, mode: "AND", header: false}
>var colM=$gridStock.pqGrid( "option", "colModel" );
>colM
[Object,Object,Object {
childCount: 0
colSpan: 1
dataIndx: 1
dataType: "string"
editor: Object
filter: Object {
   condition: "contain"
   on: true
   value: "CEREZA"
   __proto__: Object }
leftPos: 2
resizable: true
rowSpan: 1
title: "Familia"
validations: Array[2]
width: 150
__proto__: Object}
]


What I'm doing wrong?

Pages: [1]