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 - glt

Pages: [1]
1
Thanks PQ.
That was exactly what I needed.  :D

Cheers,
Geoff

2
Hi PQ,

I made a jsfiddle to illustrate what I am trying to do:
https://jsfiddle.net/glt101/xpvt214o/872647/

Let me know if I can clarify this further.

Cheers,
Geoff

3
Hi
Thanks for the response.

promoToolTip is my own function that builds the content of the dialog.
It receives strEmpCode and builds the content based on that value.
How to call a custom function in this way from a comment?

Cheers
Geoff

4
Hi PQ,

In the render function for a column, I need code that will show a jQuery dialog on cell mouseover.

I have this (doesn't work due to promoToolTip() function being out of scope):

Code: [Select]
render: function ( ui ) {
                        var oRowData = ui.rowData;
                        var oDataIdx = ui.dataIndx;
                        var strEmpCode = oRowData["EmpCode"];
                        var strCellValue = "";
                        if (oRowData[oDataIdx] == "Merit Promotion") {
                            strCellValue = "<a href=\"#\" onmouseover=\"promoToolTip('" + strEmpCode + "');\" onclick=\"return false;\">Merit  Promotion</a>";
                        }
                        else
                            strCellValue = "Merit Promotion";
                        return strCellValue;
}

Instead I need to bind the call to promoToolTip to the cell's mouseover event using jQuery.
How do I do that?

Cheers,
Geoff

5
Hi,

When doing inline row editing, if the row contains a select list, using the update button only places a small check mark in the cell's corner.
It requires another click of the update button to actually commit the row to the database. Is this expected behavior with PQGrid?
If so, can it be overridden to always fully commit when clicking the Update button?
I'll post code to demo this next week.

Cheers,
Geoff

6
Hi,

Using the code below, when I select a value, the filter applies correctly.
But when I revert the selection to --Select--, the columns don't return to
their original order. The new order is strange -it appears partially correct
after the first few rows.

Code is below.

Cheers,
Geoff


Code: [Select]
<div id="grid_array"></div>



<script>
        $(function () {
            //Initialize
            var oSummary = {
                title: "The grid",
                filterModel: {
                    on: true,
                    mode: "AND",
                    header: true,
                    type: "local"
                }
            };
           
            oSummary.colModel = [
                {
                    title: "fname",
                    dataType: "string",
                    dataIndx: "fname",
                    filter: {
                        type: 'select',
                        condition: 'equal',
                        valueIndx: "fname",
                        labelIndx: "fname",
                        prepend: { '': '--Select--' },
                        listeners: ['change']
                    }
                },
                { title: "lname", dataType: "string", dataIndx: "lname" },
                { title: "nt_id", dataType: "string", dataIndx: "nt_id" }
            ];

            oSummary.dataModel = {
                dataType: "JSON",
                location: "remote",
                method: "GET",
                url: "/PQGridPOC/PQGridPOC/Home/PrjReviews",
                getData: function (response) {
                    return { data: response };
                }
            };

            var $grid = $("#grid_array").pqGrid(oSummary);

            //Load filters
            $grid.one("pqgridload", function (evt, ui) {
                var column = $grid.pqGrid("getColumn", { dataIndx: "fname" });
                var filter = column.filter;
                filter.cache = null;
                filter.options = $grid.pqGrid("getData", { dataIndx: ["fname"] });

                $grid.pqGrid("refreshHeader");
            });

        });
</script>

7
Hi PQ.

I cleaned things up and got it working.
The main thing that was causing me grief was that the returned JSon didn't have a parent
name, so the getData function needed to be just:
return { data: response };
instead of:
return { data: response.data };

Thanks for the help :)

Cheers,
Geoff

Working code below:
Code: [Select]
<script>
        $(function () {
            //Initialize
            var oSummary = {
                title: "Grid From JSON",
                resizable: true
            };
           
            oSummary.colModel = [
                { title: "fltrID", dataType: "integer", dataIndx: "fltrID" },
                { title: "prj_code", dataType: "string", dataIndx: "prj_code" },
                { title: "days_actual", dataType: "integer", dataIndx: "days_actual" },
                { title: "days_actual_formatted", dataType: "integer", dataIndx: "days_actual_formatted" },
                { title: "days_review_threshold", dataType: "integer", dataIndx: "days_review_threshold" },
                { title: "days_inactivity_threshold", dataType: "integer", dataIndx: "days_inactivity_threshold" },
                { title: "cost_actual", dataType: "float", dataIndx: "cost_actual" },
                { title: "cost_review_threshold", dataType: "float", dataIndx: "cost_review_threshold" },
                { title: "alertStatus", dataType: "string", dataIndx: "alertStatus" },
            ];

            oSummary.dataModel = {
                dataType: "JSON",
                location: "remote",
                method: "GET",
                url: "/PQGridPOC/PQGridPOC/Home/PQGridDataSource",
                getData: function (response) {
                    return { data: response };
                }
            };

            $("#grid_array").pqGrid(oSummary);
        });
</script>

8
Help for ParamQuery Grid (free version) / First try at remote data
« on: July 21, 2018, 05:39:55 am »
Hi,

I am trying to get a first try at using location: "remote" and having no success.
I see in Fiddler that the call to the supplied URL for the data is made and a valid
JSON string is returned, but PQGrid always says, "No Rows to display".
I must be doing something dumb, but I just don't see it. Code is below.

Many thanks for any help.
Cheers,
Geoff


Returned JSon:
[{"fltrID":68247,"prj_code":"148806","days_actual":263,"days_actual_formatted":"263","days_review_threshold":8.77,"days_inactivity_threshold":2.92,"cost_actual":68.30,"cost_review_threshold":0.034150,"alertStatus":2}]


HTML/Javascript:
<div id="grid_array"></div>



<script>
        $(function () {
            //Initialize
            var oSummaryData = {
                recIndx: "fltrID", //primary key
                location: "remote",
                sorting: "local",
                dataType: "JSON",
                method: "GET",
                url: "/PQGridPOC/PQGridPOC/Home/PQGridDataSource",
                getData: function (response) {
                    return { data: response.data };
                }
            };

            var obj = {};
            obj.width = 700;
            obj.height = 400;
            obj.colModel = [
                { title: "fltrID", dataIndx: 0 },
                { title: "prj", dataIndx: 1 },
                { title: "code", dataIndx: 2 },
                { title: "days", dataIndx: 3 },
                { title: "actual", dataIndx: 4 },
                { title: "days_actual_formatted", dataIndx: 5 },
                { title: "days_review_threshold", dataIndx: 6 },
                { title: "days_inactivity_threshold", dataIndx: 7 },
                { title: "cost_actual", dataIndx: 8 },
                { title: "cost_review_threshold", dataIndx: 9 },
                { title: "alertStatus", dataIndx: 10 },
            ];

            obj.dataModel = oSummaryData;
            $("#grid_array").pqGrid(obj);
        });
</script>

Pages: [1]