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.


Topics - gmswsd

Pages: [1]
1
Help for ParamQuery Pro / Filtering issue
« on: June 19, 2020, 07:41:00 pm »
Hi,
There is an issue with the pq plugin that it prefilter the data before triggering the filter handler function:
 
This screenshot contains the output of filterhandler with all lines commented except for the first console log, the function received the original filters:
(see attachment- output_filterhandler)
 
When we uncomment the other lines, the first console log function shows filters after applying the new one:
(see attachment- console_log)
 
Also, when we use timeout handler, it triggers the function on losing focus again:
{
     type: 'textbox',
     label: 'Filter: ',
     attr: 'placeholder="Enter your keyword"',
     cls: "filterValue",
     listener: {timeout: filterhandler} --> Timeout calls the function twice after the input field loses focus
},
(see attachment- timeout)
 
Here's the function implementation:
function filterhandler(e, u) {
                console.log(this.getColModel()); --> This is called after filtering
                var $toolbar = this.toolbar(),
                    $value = $toolbar.find(".filterValue"),
                    value = $value.val(),
                    condition = $toolbar.find(".filterCondition").val(),
                    dataIndx = $toolbar.find(".filterColumn").val(),
                    filterRules;
                if (e.currentTarget.className == "filterColumn" || e.currentTarget.className == "filterCondition" && value == '') return;
                if (dataIndx == "") {//search through all fields when no field selected.
                    filterRules = this.getColModel().map(function (column) {
                        return {dataIndx: column.dataIndx, condition: condition, value: value};
                    })
                } else {//search through selected field.
                    filterRules = [{dataIndx: dataIndx, condition: condition, value: value}];
                }
                // reset to range if text is empty
                if (value == '') {
                    if (Array.isArray(filterRules)) {
                        filterRules = filterRules.map((rule) => {
                            return { ...rule, condition: 'range'}
                        });
                    } else {
                        filterRules.condition = 'range';
                    }
                }

                //call to grid filter method.
                this.filter({
                    oper: 'add',
                    mode: 'OR',
                    rules: filterRules
                }); --> This is called first!
            }
 
We tried as well implementing beforeFilter, it's still called after filtering:
beforeFilter: function (e, u) {
   console.log(u); --> This is called after filtering
},

2
Help for ParamQuery Pro / Search bar and filter model
« on: June 03, 2020, 12:25:03 am »
Hi,

When I use the global search bar when specific columns have a filter placed, the search will work but then after those columns still have the values as if they are being filtered on, but they are not. Is there a way to clear the filters during the search, or to have the search save those filters and re-apply them after?

Thanks

3
Hi

When building the colModel the below will show records where the due date is less than today, however it still shows blank values.
I tried notempty but could not get it to work.
Also how can I put this in a checkbox in the toolbar.

{title: "Due Date", width: 30, dataType: "date", filter: {
crules: [
{ condition: "less", value: new Date()}, //set initial value of filter
{ condition: "great", value: ""}
]
}},

4
Help for ParamQuery Pro / Restore State when using multiple grids
« on: May 17, 2020, 10:12:36 am »
Hi
Save state works great when using a single grid, however when using another grid on a different tab it uses the state from the initial grid.
Is there a way to still save to the cookie but give it the name of the grid?
Also, if I have a filter from filterModel saved it saves the filter it just doesn't execute on the filter when restored.

5
Help for ParamQuery Pro / How to get selected value of a dropdown?
« on: May 06, 2020, 10:03:08 pm »
In the toolbar how do I get the value of the options that was selected so it can be passed as a parameter to the function.
{
type: 'select'
options: [   ["First"],
                 ["Second"],
                 ["Third"]
             ],
listener function(){
    reload( options? );
}
}

6
ParamQuery Pro Evaluation Support / How to remove ParamQuery Pro Eval
« on: April 16, 2020, 05:18:08 pm »
I have purchased ParamQuery and see ParamQuery Pro Eval bottom right.
What do I need to do to remove it?

7
Help for ParamQuery Pro / linked/url columns break when grouped
« on: April 12, 2020, 11:11:56 pm »
Hi
Links work great and groupings work great alone.
Combined it creates links columns that are not link columns.
Below is a code example which works fine till grouped.

<!DOCTYPE html>
<html>
<head>
<!--jQuery dependencies-->
   <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css" />
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
   <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>

<!--PQ Grid files-->
    <link rel="stylesheet" href="pqgrid.min.css" />
    <link rel="stylesheet" href="pqgrid.ui.min.css" />
    <!--office theme-->
    <link rel='stylesheet' href='themes/office/pqgrid.css' />

    <script src="pqgrid.min.js"></script>
    <!--for localization and intellisense -->
    <script src="localize/pq-localize-en.js"></script>

<!--for touch devices-->
    <script src="pqTouch/pqtouch.min.js"></script>

<!--jsZip for zip and xlsx import/export-->
    <script src="jsZip-2.5.0/jszip.min.js"></script>

<style>
    *{
        font-size:12px;
    }
</style>
<script>
    function findTitle(data1, val) {
        for (var i = 0; i < data1.length; i++) {
            if (data1.title === val) return i
        }
        return ''
    }

    $(function () {
        var groupModel= {
            on: true,
            summaryInTitleRow: 'all',
            showSummary: [true]
        };
        var data = [
            [1, 'Exxon Mobil',"'https://nba.com' target='_blank'> nba.com", 339938.0, 36130.0],
            [2, 'Wal-Mart Stores',"'https://espn.com' target='_blank'> espn.com" , 315654.0, 11231.0]
        ];
        var obj = {
            numberCell:{resizable:true,title:"#",width:30,minWidth:30},
            editor: {type: 'textbox'},
            title: "ParamQuery Grid with Array data",
            resizable:true,
            groupModel: groupModel,
            scrollModel:{autoFit:true, theme:true}
        };
        obj.colModel = [
            { title: "Rank", width: 100, dataType: "integer" },
            { title: "Company", width: 200, dataType: "string" },
            { title: "Subject", width: 200, dataType: "string" },
            { title: "Revenues ($ millions)", width: 150, dataType: "float", format: '$#,###.00' },
            { title: "Profits ($ millions)", width: 150, dataType: "float", format: '$#,###.00'}
        ];
        $.extend(obj.colModel[findTitle(obj.colModel, 'Subject')], {
            render: function( ui ){
                return "<a href="+ ui.cellData + "</a>";
            }
        });
        obj.dataModel = { data: data };
        $("#grid_array").pqGrid(obj);
    });

</script>
</head>
<body>
<div id="grid_array" style="margin:100px;"></div>
</body>

</html>

8
Help for ParamQuery Pro / Dynamic hover over a header of column
« on: April 11, 2020, 02:45:29 am »
Hi,

I'm wondering how I would go about inserting dynamic tooltips for the headers and not the cells themselves.

9
Help for ParamQuery Pro / centring text in an array
« on: April 09, 2020, 01:27:29 am »
Hi,

When working with the basic array demo code, I tried to use css to structure the resulting table. I added text-align: center and vertical-align: middle to have the text be in the center of each box, but the resulting table only centers one column. How to I use css so that each box is centred?

This is the code:

<!DOCTYPE html>
<html>
<head>
<!--jQuery dependencies-->
   <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css" />
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
   <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>

<!--PQ Grid files-->
    <link rel="stylesheet" href="pqgrid.min.css" />
    <link rel="stylesheet" href="pqgrid.ui.min.css" />
    <!--office theme-->
    <link rel='stylesheet' href='themes/office/pqgrid.css' />

    <script src="pqgrid.min.js"></script>
    <!--for localization and intellisense -->
    <script src="localize/pq-localize-en.js"></script>

<!--for touch devices-->
    <script src="pqTouch/pqtouch.min.js"></script>

<!--jsZip for zip and xlsx import/export-->
    <script src="jsZip-2.5.0/jszip.min.js"></script>

<script>
    $(function () {
        var data = [
            [1, 'Exxon Mobil', 339938.0, 36130.0],
            [2, 'Wal-Mart Stores', 315654.0, 11231.0],
            [3, 'Royal Dutch Shell', 306731.0, 25311.0],
            [4, 'BP', 267600.0, 22341.0],
            [5, 'General Motors', 192604.0, -10567.0],
            [6, 'Chevron', 189481.0, 14099.0],
            [7, 'DaimlerChrysler', 186106.3, 3536.3],
            [8, 'Toyota Motor', 185805.0, 12119.6],
            [9, 'Ford Motor', 177210.0, 2024.0],
            [10, 'ConocoPhillips', 166683.0, 13529.0],
            [11, 'General Electric', 157153.0, 16353.0],
            [12, 'Total', 152360.7, 15250.0],
            [13, 'ING Group', 138235.3, 8958.9],
            [14, 'Citigroup', 131045.0, 24589.0],
            [15, 'AXA', 129839.2, 5186.5],
            [16, 'Allianz', 121406.0, 5442.4],
            [17, 'Volkswagen', 118376.6, 1391.7],
            [18, 'Fortis', 112351.4, 4896.3],
            [19, 'Crédit Agricole', 110764.6, 7434.3],
            [20, 'American Intl. Group', 108905.0, 10477.0]
        ];

        var obj = {
            numberCell:{resizable:true,title:"#",width:30,minWidth:30},
            editor: {type: 'textbox'},
            title: "ParamQuery Grid with Array data",
            resizable:true,
            scrollModel:{autoFit:true, theme:true}
        };
        obj.colModel = [
            { title: "Rank", width: 100, dataType: "integer"},
            { title: "Company", width: 200, dataType: "string" },
            { title: "Revenues ($ millions)", width: 150, dataType: "float", format: '$#,###.00' },
            { title: "Profits ($ millions)", width: 150, dataType: "float", format: '$#,###.00'}
        ];
        obj.dataModel = { data: data };
        $("#grid_array").pqGrid(obj);
    });

</script>
</head>
<body>
<div id="grid_array" style="margin:100px"></div>
<style>
    *{
        font-size:12px;
        font-family: Arial;
        text-align: center;
        vertical-align: middle;
       
    }
</style>
</body>

</html>


Thanks

10
Help for ParamQuery Pro / How do you Bold the Header?
« on: April 05, 2020, 09:52:28 pm »
Please provide an example of how to bold the Header

Thanks
Glenn

11
ParamQuery Pro Evaluation Support / How to make a href in a cell?
« on: March 30, 2020, 10:23:28 am »
Does this grid allow for clickable cells.
<a href="https://www.nba.com">NBA Basketball</a>
I could not find any examples of this.
Could you provide and example?

Pages: [1]