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

Pages: [1]
1
Help for ParamQuery Pro / Re: How to use change event of pager
« on: November 04, 2017, 01:01:45 am »
You opened my eyes to a much better method of initialization and pq object referencing than the way I had been using.  That allowed me to reference everything is a simple way.  Thanks for your help, I truly appreciate the quick reply ! You've saved me so much frustration with finishing this feature solution.

2
Help for ParamQuery Pro / Re: How to use change event of pager
« on: November 03, 2017, 10:37:37 pm »
I tossed a jsfiddle together for a populated data sample:

http://jsfiddle.net/vekf4md0/4/

3
Help for ParamQuery Pro / How to use change event of pager
« on: November 03, 2017, 09:54:06 pm »
I strongly believe there is a bug in the "change" event for the pqPager.  If not, please explain what is incorrect.

Using your demo "Paging - local paging" (https://paramquery.com/pro/demos/paging_local), I put my modifications in for paging widget desirable functionality.  The paging controls do not work when the "change" event is incorporated, and the "500000 : All" text works fine when the event is not utilized, but breaks when it is set.

Please help me resolve this issue, it is a feature the client needs and I have spent an exhausting amount of time trying to resolve it, but I can only deduce that it's an API bug. 

This script put into the demo page javascript editor window will provide my frustrating :o experience:
Code: [Select]
    $(function () {
        var colM = [
            { title: "Order ID", width: 100, dataIndx: "OrderID" },
            { title: "Customer Name", width: 130, dataIndx: "CustomerName" },
            { title: "Product Name", width: 190, dataIndx: "ProductName" },
            { title: "Unit Price", width: 100, dataIndx: "UnitPrice", align: "right" },
            { title: "Quantity", width: 100, dataIndx: "Quantity", align: "right" },
    { title: "Order Date", width: 100, dataIndx: "OrderDate" },
    { title: "Required Date", width: 100, dataIndx: "RequiredDate" },
    { title: "Shipped Date", width: 100, dataIndx: "ShippedDate" },
            { title: "ShipCountry", width: 100, dataIndx: "ShipCountry" },
            { title: "Freight", width: 100, align: "right", dataIndx: "Freight" },
            { title: "Shipping Name", width: 120, dataIndx: "ShipName" },
            { title: "Shipping Address", width: 180, dataIndx: "ShipAddress" },
            { title: "Shipping City", width: 100, dataIndx: "ShipCity" },
            { title: "Shipping Region", width: 110, dataIndx: "ShipRegion" },
            { title: "Shipping Postal Code", width: 130, dataIndx: "ShipPostalCode" }
];
        var dataModel = {
            location: "remote",           
            dataType: "JSON",
            method: "GET",
            url: "/pro/invoice/get",
            //url: "/invoice.php", //for PHP
            getData: function (dataJSON) {
                return { data: dataJSON.data };
            }
        }
var rPP_recall = getCookie("pqPager-rPP");
rPP_recall = (rPP_recall > 1 ? rPP_recall : 25 )
        var grid1 = $("div#grid_paging").pqGrid({
            width: 900,
            height: 400,
            collapsible: false,
/* customized pageModel */
            pageModel: {
            type: "local",
rPP: rPP_recall,
strRpp: "{0}",
strDisplay: "{0} to {1} of {2}",
rPPOptions: [25, 50, 100, 500, 1000, 500000],
            change: function (evt, ui) {
                if (ui.rPP) {
                    setCookie("pqPager-rPP", ui.rPP, 365);
                }
            }
        },
            dataModel: dataModel,
            colModel: colM,
            wrap: false, hwrap: false,
            freezeCols: 1,           
            numberCell: { show: false, resizable: true, title: "#" },
            title: "Shipping Orders",
            resizable: true,
/* customized paging option:last-item on grid refreshing -- changes select text 500000 to show "All"  */
        refresh: function () {
            var pager = this.pager();
            if (pager) {
                pager.widget().find("option:last").html("All");
            }
        }
        });
   
/* customized dummy functions for my user pref. set & get values -- hardcoded return value=100 & simplified to make a console note of occurrence for debug */
    function setCookie(cname, cvalue, exdays) {
        console.log("setCookie: " + cname + " = " + cvalue)
    }

    function getCookie(cname) {
        console.log("getCookie: " + cname + " = 100");
        return 100;
    }

});

4
Help for ParamQuery Pro / Re: Pager widget - adding the "All" paging opton
« on: November 02, 2017, 12:33:54 am »
I had tested both ways and thought the arbitrary number was a bit of a pitfall for a "community" solution.  Thanks for the simplified version, however I am still having trouble digesting the pager().widget() model, now I constantly run into an event failure.

After initializing the grid object, I am saving (to cookie) the user's last selected preference for the pager: options, rPP
However, I cannot get the .on('change') event to progress/work properly.  What object / select do I use inside the function on event  pager:change( function(event,ui){...  ???

What am I doing wrong with this event handler ? 
Code: [Select]
var grid_obj = {
        /*...init. setup options...*/
        bubble: {on: true},
        refresh: function () {
            var pager = this.pager();
            if (pager) { pager.widget().find("option:last").html("All"); }
        },
        create: function () {
            var pager = this.pager();
            if (pager) {
                pager.widget().pqPager({
                    change: function (evt, ui) {
                        $(this).find("option:last").html("All");  // <-- THIS fails to work and also on select list change, refresh fails

                        //the following is basically working without error
                        if (ui.rPP){
                            setCookie("pqPager-" + sModel, ui.rPP, 365);
                            return true;
                        }
                    }
                });
            }
        }
}

5
Help for ParamQuery Pro / Pager widget - adding the "All" paging opton
« on: October 31, 2017, 01:18:33 am »
I believe this may help some folks, I had been trying to achieve the Paging control option for an "All" option after finding this is not a built-in feature.  I think my code addresses the paging option cleanly with no extra toolbar buttons.  Please review and correct if I'm wrong, or share for the community. Thanks!

var gridSample = $("#divGrid").pqGrid({
title: "Frank Z. sample",
pagemodel: {type: "local", rPP: 25},
dataModel: datModel,
colModel: colModel,
refresh: function (ui) {
                var $pager = this.pager().widget();
                if ($pager && $pager.length) {
                    var nAll=( $pager.pqPager("option", "totalRecords") );
                                        $pager.pqPager( "option", "rPPOptions", [10,25,nAll] );
                                        $($pager).find("select:last-of-type").find("option:last-of-type").html("All");
                }
});

6
Help for ParamQuery Pro / Re: Mystery error on subsequent grid loads
« on: September 23, 2017, 12:46:40 am »
 I overlooked that, you're absolutely correct.  Issue resolved.  THANK - YOU - SIR !

7
Help for ParamQuery Pro / Re: Mystery error on subsequent grid loads
« on: September 22, 2017, 11:24:01 pm »
Thanks for reply!  My appology for unparsed logfile, Notepad++ does nice job opening those, so I must not have save EOL conv. after parsed. 

I finally did get a test with exact same browser on both ends.  Confirmed that Prod test with IE11 is clean, as is no errors as the case on dev. 
Tests with Chrome 60.x on both sides is where the errors halt pgGrid as seen in the log, I have attached parse the log and after running with pggrid.dev.js

Errors begin on pgGrid.dev.js [Line 1762]:   l.$stripe = s

So this is at least consistent on both systems, just cannot see anything that is causing Chrome to flop. 

Prod is an intranet. I can send my pqGrid init javascript and html, the rest in not easily supplied, but I can save a data request result to flat file for simulation if need be.

Process of subsequent requests originate from the same custom/simple SPA form.  I am posting all new requests to the server via $.ajax().post, round-trip results with XML and being parsed. The first load runs fine on Chrome, say for Customer Name, then I narrow down to Invoice No., crashes on that load. These are complete pgGrid loaded results on first load, then next load is stuck with the Grid Loading.. and errored out behind the scenes.  IE 11 performs subsequent requests without fail, as many as I type and submit.

Thanks.

8
Help for ParamQuery Pro / Re: Mystery error on subsequent grid loads
« on: September 22, 2017, 08:41:06 pm »
This issue is not occurring in IE11 on dev. VM, but installed new Chrome and see same issue on VM.  I'm putting in a bunch more console logging for help pin pointing the call stack issue.

9
Help for ParamQuery Pro / Re: Mystery error on subsequent grid loads
« on: September 22, 2017, 01:07:42 am »
Using version:  ParamQuery Pro v4.0.1

10
Help for ParamQuery Pro / Mystery error on subsequent grid loads
« on: September 22, 2017, 01:03:55 am »
I developed an application using pqGrid, with server-side xml being provided.  My grid initializes, ajax returns the xml, .paramquery.xmlToJson() converts for pqGrid, all is working beautifully on my dev. virtual machine.  VM tests great in IIS7 and IIS express.  But pqGrid.min.js script crashes (see log file) once installed on the customer intranet server running MS Server 2003, which needed upgraded/config. to run .NET.  I had to enable .WOFF/.WOFF2 files extensions, so I realize it was quite out of sync with current practices.  The concern I have is the javascript libraries, .ts and .map files potentially being unhandled.

The problem is very peculiar, the first init. and data load of the grid is trouble free, no errors, works as desired.  All subsequent attempts are throwing errors in the browser console.  Please see the (Chrome v.60.x) browser console log file attached.  Does the pqGrid error look familiar or make any sense to you ?

I have spent mega+ hours on this project designing it completely from ground up focused on pqGrid pro, and works error free on my server.  Ready for client testing phase and now I cannot afford to dissect the pqGrid script for potential errors.  The customer is raring to get this tested and into production as soon as possible.

If you need my javascript for pqGrid init or have any questions, I'll be glad to share.  Also is it at all possible an IIS config. would affect pgGrid libraries ?
Thanks for anything you can provide.

These are all my client side library references FYI:
!-- page CSS --
css/w3.css
css/googleapis.css
css/font-awesome-4.7.0/css/font-awesome.min.css
   
!-- jquery refs --
scripts/jquery.min.js

!--jqueryui refs --
scripts/jquery-ui/jquery-ui.css
scripts/jquery-ui/jquery-ui.min.js

!--PQ Grid files--
scripts/pqgrid.min.js

!--PQ Grid files--
scripts/pqgrid.min.css
scripts/pqgrid.ui.min.css

!--jqueryui touch punch for touch devices--
scripts/touch-punch/touch-punch.min.js

!--PQ Grid Office theme--
scripts/themes/steelblue/pqgrid.css

!-- jsZip for zip and xlsx export--
scripts/jsZip-2.5.0/jszip.min.js
Scripts/jsZip-2.5.0/filesaver.min.js

scripts/pqGrid_init.js
Scripts/jqMain.js

Pages: [1]