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

Pages: [1]
1
Hi Paramvir, we are upgrading PQ grid version from 3.3 to 9.1. After updates we faced issue of Localization for pager. Can you please provide a demo url for version 9.1, I gone through https://paramquery.com/demos/localize which is for ver 3.X.

2
Hi
 
I had try this by removing "scrollModel.autoFit:  true", but then empty columns are showing on the right hand side of the grid, if columns has less in grid.
 
Also i have try with other jqueryUI version. but still not worked. Currently i am using jqueryUI version 1.14.1 which is latest version.
 
Thanks.

3
Thanks , Its working.

4
Hello,

I have upgraded PQ Grid version to 9.1.1 from 3.3 and JQuery version to 3.7.1 from 2.1.4.

After upgraded this, in PQ grid Horizontal scrollbar not getting displayed, if columns having more in grid.

In my case PQ grid column's are not fixed. I can select/unselect column's from dropdown also to display in the grid as per requirement. previously it was working as expected.


Please advise.
Thanks.

5
Hi Paramvir, I found the cause of issue its because of jQuery version Library v3.7.1 . So any work around for jQuery 3x version as it working fine with jQuery 2x. versions ?

6
I have updated the code as per new V 9.1, please JSFiddle- https://jsfiddle.net/s270rzho/latest/ and  find below code block and let me know if you found anything missing.

//common options used in all grids.
var options = {
    fillHandle: 'all',
    blur: function () {
        this.Selection().removeAll();
    }
};

//Initialize the Main Grid
function InitialiseDevicesgrid() {
 
    //initialize main grid
    $("#DeviceList").pqGrid(Object.assign({}, options, {
        width: '100%',
        height: CalculateGridHeight(),
        dataModel: { location: "local" },           
        scrollModel: {autoFit:true, flexContent: true },
        stripeRows: true,
        collapsible: false,
        flex: { one: true },
        selectionModel: { type: 'row' },
        hwrap: false,
        wrap: false,
        create: function (evt, ui) {
            var colMod = [{ value: "Gateway", title: "Gateway" }, { value: "DataSource", title: "DataSource" }, { value: "DataTransfer", title: "DataTransfer" }, { value: "System", title: "System" }, { value: "Module", title: "Module" }],
                $sel = $("#SearchList"),
                optionElement = '';
           
            // add column to the dropdown
            $.each(colMod , function (i, column) {
                optionElement = '<option value="' + column.value + '">' + column.title + '</option>';
                $sel.append(optionElement);
            });
            // Refresh to show
            $sel.selectpicker('refresh');
        },
       
        colModel: [
            {
                title: "", minWidth: 27, maxWidth: 27, type: "detail", resizable: false, editable: false, sortable: false,
                render: function (ui) { ui.rowData.rowId = 'DeviceList_' + ui.rowIndx; }
            },
            { title: 'Customer', dataIndx: 'customer_name', editable: false, render: filterRender }
        ],
        numberCell: { show: false },
        sortModel: { sorter: [{ dataIndx: "customer_name", dir: "up" }], cancel: false, type: "local" },
        resizable: true,     
        toolbar: {
            cls: "pq-toolbar-search",
            items: [
                {
                    type: 'textbox',
                    attr: 'placeholder="' + "Find" + '"',
                    cls: "filterValue clearable",
                    listeners: [
                        { 'keyup': DevicesSearchHandler },
                        { 'change': DevicesSearchHandler }
                    ]
                },
                {
                    type: '<select id="SearchList" class="search-list" data-width="150px" data-height="10px" data-style="btn-default btn-sm" data-dropup-auto=false></select>'
                }
            ],
        },
       
        detailModel: {
            cache: true,           
            collapseIcon: "ui-icon-plus",
            expandIcon: "ui-icon-minus",
            init: function (ui) {
                var rowData = ui.rowData,                       
                    dataHubDetailObj = gridDataHubDetailModel(this, rowData), //get a copy of gridDetailModel                       
                    $grid = $("<div id=" + rowData.rowId + "></div>").pqGrid(dataHubDetailObj); //init the detail grid.
                return $grid;
            }
               
        },
        cellClick: function (event, ui) {
            if (typeof ui.rowData.pq_detail != 'undefined') {
                $("DeviceList_1").pqGrid("showLoading");
                //$('#' + ui.rowData.rowId).pqGrid("showLoading");
                if ((typeof ui.rowData != 'undefined') && (ui.rowData.pq_detail.show)) {
                    if (initialisedDataHubsGridIds.indexOf(ui.rowData.rowId) < 0) { initialisedDataHubsGridIds.push(ui.rowData.rowId); }
                } else if ((typeof ui.rowData != 'undefined') && (!ui.rowData.pq_detail.show)) {
                    initialisedDataHubsGridIds.pop(ui.rowData.rowId);
                }
            }
       
        }
    }));

    $("#SearchList").on('changed.bs.select', function (e, clickedIndex, newValue, oldValue) {
        //Reset the Grid and then continue searching with the changed value
        for (var i = 0; i < searchGridIds.length; i++) {
            $(searchGridIds).pqGrid("reset", { filter: true });
        }
        DevicesSearchHandler();
    });
}

function onTabsActive(evt, ui) {
    //grid requires refresh whenever corresponding tab is refreshed.
    ui.newPanel.find(".pq-grid").pqGrid("refresh");
};

//Datahub Grid function called by Main Grid
var gridDataHubDetailModel = function (gridMain, rowData) {
    var datahubGridId = '#' + rowData.rowId;
    return Object.assign({}, options, {
        width: "100%",
        pageModel: { type: "local", rPP: 10, curPage: 1, strDisplay: "{0} to {1} of {2}" },
        columnBorders: false,
        showTop: false,
        showBottom: true,
        scrollModel: { autoFit: true, flexContent: true },
        dataModel: {
            location: "remote",               
            dataType: "JSON",
            method: "GET",
            url: "../connections/datahubs/" + updatedEncodeURIComponent(rowData.customer_name) + "?customerName=" + updatedEncodeURIComponent(rowData.customer_name) + "&region=" + updatedEncodeURIComponent(rowData.region) + "&country=" + updatedEncodeURIComponent(rowData.country) + "&city=" + updatedEncodeURIComponent(rowData.city),
            getData: function (dataJSON) {
                var data = dataJSON.datahubs;
                if (typeof data != "undefined" && JSON.stringify(data) != "") {
                    for (var i = 0; i < dataJSON.datahubs.length; i++) {
                        data.hub_name = data.name;
                    }
                }
                return { curPage: dataJSON.curPage, totalRecords: dataJSON.length, data: data };
            }
        },
        colModel : [
            { title: "", minWidth: 27, maxWidth: 27, type: "detail", resizable: false, editable: false, sortable: false },
            {
                title: "Lab Name", width: "15%", dataType: "string", dataIndx: "hub_name", editable: false, sortable: true, render: filterRender
            },
         {
                title: "Gateway Name", width: "25%", dataType: "string", dataIndx: "dns_name", editable: false, sortable: true, render: function (ui) {
                    var gatewayName = (typeof ui.rowData.dns_name != 'undefined' && ui.rowData.dns_name.trim() != '')?ui.rowData.dns_name:ui.rowData.datahub_id;
                    return {
                        text: "<span title='" + ReplaceSpecialCharacter(gatewayName) + "'>" + gatewayName + "</span>"
                    };
            }
            },
            {
                title: "Status", dataType: "string", dataIndx: "status", editable: false, sortable: true, width: "15%",
                render: function (data) {
                    return {
                        text: "<span class='" + GetStatusBitforConnectionStatus(data.rowData.status)["css"] + "'></span>" + "<span>  " + filterRender(data) + "</span>"
                    };
                }
            },
            {
                title: "Last Contact Time", dataType: "date", dataIndx: "last_contact_time", editable: false, sortable: true, width: "20%",
                render: function (data) {
                    var lastContactDate = new Date(data.rowData.last_contact_time);
                    var currentDate = new Date();
                    var cellHTML = '';
                    if (currentDate - lastContactDate <= 360000) {
                        cellHTML = cellHTML + "<span class='status-text-green'";
                    }
                    else if (currentDate - lastContactDate <= 86400000 && data.rowData.statusBit == 1) {
                        cellHTML = cellHTML + "<span class='status-text-orange'";
                    }
                    else {
                        cellHTML = cellHTML + "<span class='status-text-red'";
                    }
                    cellHTML = cellHTML + " title = '" + ReplaceSpecialCharacter(getDisplayDateTime(new Date(data.rowData.last_contact_time))) + "'>" + getDisplayDateTime(new Date(data.rowData.last_contact_time)) + '</span>';
                    return {
                        text: cellHTML
                    };
                }
            },
            {
                title: "",
                dataIndx: "DeleteDataHub",
                align: "center",
                editable: false,
                sortable: false, width: "12%",
                render: function (ui) {
                    ui.rowData.rowId = rowData.rowId + "_" + ui.rowIndx;
                    return {
                        text: "<a class='my-tool-tip' data-toggle='tooltip' data-placement='left' title='Delete Gateway'><i class='glyphicon glyphicon-trash' style='font-family:Glyphicons Halflings'></i></a>",
                    };
                }
         },
         {
            title: "",
            dataIndx: "AnonymizeDataHub",
            align: "center",
            editable: false,
                sortable: false, width: "12%", 
            render: function (ui) {
               ui.rowData.rowId = rowData.rowId + "_" + ui.rowIndx;
               return {
                        text: (ui.rowData.status.toLowerCase() != 'anonymized')?
                        "<a class='my-tool-tip' data-toggle='tooltip' data-placement='left' title='Anonymize Gateway'><i class='glyphicon glyphicon-user' style='font-family:Glyphicons Halflings'></i></a>":
                        "<a class='my-tool-tip' data-toggle='tooltip' data-placement='left' title='Gateway successfully anonymized' style='cursor: not-allowed' disabled><i class='glyphicon glyphicon-user' style='font-family:Glyphicons Halflings;color:Gray'></i></a>"
               };
            }
         }
        ],
        refresh: function (evt, ui) {
            if (ui.source != "flex") {
                this.flex();
            }
        },
        flex: { one: true },
        height: 'flex',
        numberCell: { show: false },   
        complete: function (event, ui) {
            AddRefreshTextInParamQueryGrid();
        },
        sortModel: { sorter: [{ dataIndx: "hub_name", dir: "up" }], cancel: false, type: "local" },
        detailModel: {
            collapseIcon: "ui-icon-plus",
            expandIcon: "ui-icon-minus",
            cache: false,
            init: function (ui) {
                var rowData = ui.rowData,
                    rdata = rowData,
                    dataHubDetailObj = gridDataSourceDetailModel($(this).pqGrid('instance'), rdata),
                    html = $("#tmpl").html(),
                    //create new detail place holder
                    $grid = $("<div tabindex='0'></div>");

                dtsDetailObj = gridDTSDetailModel($(this).pqGrid('instance'), rdata),
                    $grid = $("<div tabindex='1'></div>");

                html = html.replace("%=1", "#" + rowData.rowId);
                html = html.replace("%=2", "#DTS" + rowData.rowId);
                html = html.replace("%=id-1", rowData.rowId);
                html = html.replace("%=id-2", "DTS" + rowData.rowId);

                $grid.html(html);

                $grid.find(".pq-tabs").tabs().on("tabsactivate", onTabsActive);

                //append pqGrid in the 2nd tab.   
                var id = "#" + rowData.rowId;
                $("<div/>").appendTo($(id, $grid)).pqGrid(dataHubDetailObj);
                $grid.find(id + "> .pq-grid").attr('id', "Tab" + rowData.rowId);
                var dtsId = "#DTS" + rowData.rowId;
                $("<div/>").appendTo($(dtsId, $grid)).pqGrid(dtsDetailObj);
                $grid.find(dtsId + "> .pq-grid").attr('id', "TabDTS" + rowData.rowId);
                gridId = rowData.rowId;
                return $grid;
            }
        },
        cellClick: function (event, ui) {
            if (typeof ui.rowData.pq_detail != 'undefined') {
                if ((typeof ui.rowData != 'undefined') && (ui.rowData.pq_detail.show)) {
                    if (initialisedDataSourceGridIds.indexOf("Tab" +ui.rowData.rowId) < 0) {
                        initialisedDataSourceGridIds.push("Tab" + ui.rowData.rowId);
                    }
                    if (initialisedDTSGridIds.indexOf("TabDTS" + ui.rowData.rowId) < 0) {
                        initialisedDTSGridIds.push("TabDTS" + ui.rowData.rowId);
                    }
                } else if ((typeof ui.rowData != 'undefined') && (!ui.rowData.pq_detail.show)) {
                    initialisedDataSourceGridIds.pop("Tab" + ui.rowData.rowId);
                    initialisedDTSGridIds.pop("TabDTS" + ui.rowData.rowId);
                }
            }
            if (ui.column != undefined && ui.column.dataIndx == 'DeleteDataHub') {
                var id = ui.rowData.id, level = "datahub";
                if(ui.rowData.status != "Connected") {
                    var url = "../api/GetDeviceCount/" + updatedEncodeURIComponent(id) + "/" + updatedEncodeURIComponent(level);
                    var requestResult = Ajax(url);
                    requestResult.done(function (data) {
                        if (data == 0) {
                            var Id = { level: "datahub", datahubId: ui.rowData.id, datasourceId: null, systemId: null, moduleId: null };
                            ShowDeviceManagementAlert('confirmGatewayDeletion', {"Id":Id, "datahubGridId": datahubGridId });
                        } else {
                            ShowDeviceManagementAlert('dataSourceDelete');
                        }
                    });
                } else {
                    ShowDeviceManagementAlert('connectedDevice', {"deviceType": "Gateway"});
                }
         }
            else if (ui.column != undefined && ui.column.dataIndx == "AnonymizeDataHub" && ui.rowData.status.toLowerCase() != 'anonymized') {
                var id = ui.rowData.id, level = "datahub";
            var url = "../api/GetAnonymizationRequestStatus/" + updatedEncodeURIComponent(id) + "/" + updatedEncodeURIComponent(level);
                ShowLoading("Checking...");
                var requestResult = Ajax(url);
                requestResult.done(function (data) {
                    HideLoading();
                    if (data == 0) {
                        ShowDeviceManagementAlert('confirmAnonymization', { 'dns_name': ui.rowData.dns_name, "ui":ui })
                    } else if (data == 1) {
                        ShowDeviceManagementAlert('anonymizationScheduled',{'dns_name': ui.rowData.dns_name})
                    } else if (data == 2) {
                        ShowDeviceManagementAlert('anonymizationCompleted', { 'dns_name': ui.rowData.dns_name })
               } else {
                  alert('There was error while adding Gateway anonymization request. Kindly try after some time.');
               }
            });
         }
        }
    });
};

7
Hello,

I have updated PQ Grid to Ver 9.1 from 3.3, and have some nested grids with "remote" Datamodel.
In newer version "Loading" box not displaying for nested grids , I also gone through https://paramquery.com/pro/demos91 and updated the code as well.

Please let me know if i missed any thing or have any other impacts.


Thanks.

8
We want only single selected dropdown filter in ParamQuery grid 9.1.1 as similar as in older version.
Only the concern is about view, we only need similar view as previous.
Can we do that in latest version 9.1.1?

9
Hello Paramvir,
We are upgrading from ParamQuery Pro v3.3.0 to ParamQuery Pro v9.1.1.
We have observed modifications in new version that the filter dropdown in pqgrid is not similar to old version.
It is having checkboxes (multiselect option dropdown).
Is it to possible to make it as similar as older version in current ParamQuery Pro v9.1.1.
I am attaching screenshots of dropdown filters of both versions.

Please share your thoughts on this.

10
Hello Paramvir, we are upgrading from ParamQuery Pro v3.3.0 to ParamQuery Pro v9.1.1. We had several web pages created using pqgrid and almost working fine, among them one page where PQGrid is in Modal popup and only this grid is not displaying properly.
We observed this grid in modal popup not display properly (i.e header and some rows not displaying) and grid on parent screen get affected/overlapped.
Please go through attached screen shot of Ver 3.3 and Ver 9.1 so you will get an idea.

It was working fine with ParamQuery Pro v3.3.0 version.

Any thoughts/suggestions ?

11
Yes , working now. Added rules to set default filter.

And added key as [key] in option, so localization working now.
sample -
options: [ { [Key1]: value1 }, { [Key2]: value2 }, { [Key3]: value3 }]


Thank You .

 

12
Super!! It's working now, I have removed  pqgrid js from Modal popup and added to parent page. Thank You!!

13
Hello, we are upgrading from ParamQuery Pro v3.3.0 ParamQuery Pro v9.1.1.
We have observed couple of modifications in new version,
1. Select Filter is displaying key instead of value for selected option. how to get display value instead of key?
2. How to set default option in new version.
3. The key value pair from option is now only accepting constants for key, so because of its localization does not work well.

I have gone through https://paramquery.com/pro/demos/filter_custom

  I have attached screen shots, for more clarity.


Any thoughts?


14
Hello, we are upgrading from ParamQuery Pro v3.3.0 ParamQuery Pro v9.1.1. We had several web pages created using pqgrid and almost working fine, among them one page where we have PQGrid in Modal popup. It is throwing below JS error while opening Modal popup second time (i.e First time works well, if I closed modal popup and opened again then throwing error).

Uncaught TypeError: Cannot redefine property: nodeClose
    at Function.defineProperty (<anonymous>)
    at new t.cTree (<anonymous>:9:256586)
    at HTMLDocument.<anonymous> (<anonymous>:9:256436)
    at HTMLDocument.dispatch (jquery-3.7.1.js:2:40035)
    at v.handle (jquery-3.7.1.js:2:38006)
    at Object.trigger (jquery-3.7.1.js:2:70124)
    at obj.<computed>.triggerHandler (jquery-3.7.1.js:2:70811)
    at e._create (<anonymous>:9:39969)
    at $.<computed>.<computed>._create (jquery-ui.js:143:25)
    at $.<computed>.<computed>._super (jquery-ui.js:128:35)


It was working fine with ParamQuery Pro v3.3.0 version.

Any thoughts ?


Pages: [1]