Author Topic: Unable to Resize the column  (Read 480 times)

afterhours2

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 8
    • View Profile
Unable to Resize the column
« on: January 19, 2023, 02:31:00 am »
Hi Team,

I am using Paramquery pro v8.5

I am unable to resize the column even after setting the column.resizable to "True". I see that the cursor changes to "col-resize" on hover, however when I click and drag, column does not resize.

Below is the code, Thanks in advance

$(function () {
        var pqIS = {
            totalRecords: 0,
            pending: true,
            rpp: 25, //records per request.           
            init: function () {
                this.data = [];
                this.requestPage = 0;
            }
        };
        pqIS.init();

        var obj = {
            selectionModel: { type: null },
            scrollModel: {
                autoFit: false
            },
            postRenderInterval: -1,
            numberCell: { width: 50},           
            title: "Crew List",
            virtualX: true, virtualY: true,
            resizable: true,
            filterModel: { on: true, header: true, type: 'remote' },
            sortModel: { type: 'remote', sorter: [{ dataIndx: 'employeeNo', dir: 'up'}] },
            beforeSort: function (evt) {
                if (evt.originalEvent) {//only if sorting done through header cell click.
                    pqIS.init();
                }
            },
            beforeTableView: function (evt, ui) {
                var finalV = ui.finalV,
                    data = pqIS.data;
                if (ui.initV == null) {
                    return;
                }
                if (!pqIS.pending && finalV >= data.length - 1 && data.length < pqIS.totalRecords) {
                    pqIS.requestPage++;
                    pqIS.pending = true;
                    //request more rows.
                    this.refreshDataAndView();
                }
            },
            rowSelect: function (evt, ui) {
               
            $("#Id").val(ui.addList[0].rowData.id);
               
            }
        };
        obj.colModel = [
            { title: 'Select', align: 'center', editable: false,sortable: false, resizable: true,
             render: function (ui) {
                return "<input type='radio' name='radio100'/>";
             },
             postRender: function (ui) {               
                var grid = this;
                $(ui.cell).find('input').prop('checked', ui.rowData.pq_rowselect).on('change', function (evt) {                           
                   grid.SelectRow().replace({ rowIndx: ui.rowIndx });
                });
             }
            },
           
            { title: "Employee No", dataIndx: 'employeeNo', minWidth: 120,maxWidth: 200, align: "center", sortable: true, resizable: true, editable:false, nodrag: true, nodrop: true },
            { title: "First Name", dataIndx: 'firstName' , minWidth: 120,maxWidth: 200, align: "center", sortable: true, resizable: true, editable:false, nodrag: true, nodrop: true  },
            { title: "Last Name", dataIndx: 'lastName', minWidth: 120,maxWidth: 200, align: "center" , sortable: true, resizable: true, editable:false, nodrag: true, nodrop: true    },
           
        ];
       
       
        obj.dataModel = {           
            dataType: "JSON",
            location: "remote",
            url: "CrewListGrid.do",
            postData: function () {
                return {
                    pq_curpage: pqIS.requestPage,
                    pq_rpp: pqIS.rpp
                };
            },
            getData: function (response) {
                var data = response.data,
                    len = data.length,
                    curPage = response.curPage,
                    pq_data = pqIS.data,
                    init = (curPage ) * pqIS.rpp;
                pqIS.pending = false;
                pqIS.totalRecords = response.totalRecords;
                for (var i = 0; i < len; i++) {
                   
                    pq_data[i + init] = data;
                }
               window.scrollTo(0,document.body.scrollHeight);
                return { data: pq_data }
            },
            error: function (jqXHR, textStatus, errorThrown) {
               //alert("reached error");
               //$(operationResponse).val("Error");
               document.getElementById("gridCrewResult").innerHTML = "Failed to Reload Data, Please Try again";
                //displayError("Failed to Reload Data", "errorId_crewlist");
            }
           
        };

        $("#grid_infinite").pqGrid(obj);
    });

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6311
    • View Profile
Re: Unable to Resize the column
« Reply #1 on: January 19, 2023, 02:16:12 pm »
Are you trying to resize columns beyond minWidth or maxWith of the column because that won't work.

If that's not the case, could you please share a jsfiddle as I don't see anything wrong in your code. Please also mention jQuery, jQueryUI version.

afterhours2

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Unable to Resize the column
« Reply #2 on: February 11, 2023, 02:03:57 am »
We have grid implemented in one of other projects which uses Paramquery v3.2. The grid code is similar to the previous project. I am able to expand grid in the old project.

I am getting below exception from the console. would this help ?

jquery-1.11.0.js:248 Uncaught Error: no such method 'instance' for draggable widget instance
    at Function.error (jquery-1.11.0.js:248:9)
    at HTMLDivElement.<anonymous> (jquery-ui-1.10.4.custom.js:491:15)
    at Function.each (jquery-1.11.0.js:384:23)
    at jQuery.fn.init.each (jquery-1.11.0.js:137:17)
    at $.fn.<computed> [as draggable] (jquery-ui-1.10.4.custom.js:483:9)
    at _pq.cResizeColumns._setDragLimits (pqgrid.dev.js:7400:14)
    at HTMLDivElement.helper (pqgrid.dev.js:7354:11)
    at $.<computed>.<computed>._createHelper (jquery-ui-1.10.4.custom.js:1749:49)
    at $.<computed>.<computed>._createHelper (jquery-ui-1.10.4.custom.js:401:25)
    at $.<computed>.<computed>._mouseStart (jquery-ui-1.10.4.custom.js:1565:22)

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6311
    • View Profile
Re: Unable to Resize the column
« Reply #3 on: February 13, 2023, 01:25:17 pm »
Please use jQueryUI version >= 1.11.4