Author Topic: Grid Error  (Read 2314 times)

Sivakumar

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 32
    • View Profile
Grid Error
« on: April 02, 2020, 10:21:28 pm »
Hi,
Below Code is my Example of how my grid is binding but it is not binding the data but the data is coming in response
and when i bind the grid the below error occurs and grid is not binding

pqgrid.min.js:11 Uncaught TypeError: Cannot read property 'wdCenter' of undefined
    at pq.cRenderBody.refreshColumnWidths (pqgrid.min.js:11)
    at pq.cRenderBody.init (pqgrid.min.js:19)
    at t.paramquery.cRefresh.refresh (pqgrid.min.js:12)
    at pqgrid.min.js:12
    at pqgrid.min.js:12


example


var $Associate_DocumentsGridPartial;
var colM = [];
var primaryColumn;
function bindAssociateDocumentGridPartial(standardID, tableName, clasName) {
    var url = window.location.origin + "/Document/GetAllDocumentsAndAssociation";
 

    var pData = { StandardID: standardID, TableName: tableName, ClasName: clasName };

   
        primaryColumn = "ID";

        $.post(url, pData, function (data, status) {
            debugger;
            var response = JSON.parse(data);
            if (jQuery.isEmptyObject(response.data)) {
                $("#DocumentListPartial").modal('hide');
                return false;

            }

            colM = [];
            colM.push({ title: '', dataIndx: 'ID', hidden: true });
            colM.push({ title: '', dataIndx: 'TableName', hidden: true });

            $.map(response.data.Table[0], function (v, k) {
                if (k.toUpperCase() == "ISASSIGNED") {
                    colM.push({
                        title: '<b>' + toTitleCase(k) + '</b>', copy: false, dataIndx: k, halign: "center", width: 50, dataType: "integer", align: 'center', editable: true, menuIcon: false,
                        type: 'checkbox',
                        filter: { crules: [{ condition: "equal" }], options: [{ 0: 'UnCheck' }, { 1: 'Checked' }] },
                        cb:
                        {
                            all: true,
                            header: true,
                            check: 1,
                            uncheck: 0
                        },
                        editor: false
                    });

                }
                else if (k.toUpperCase().indexOf("DOCUMENT_TYPE_NAME") > -1) {
                    colM.push({ title: k, dataIndx: k, hidden: false, editor: false });
                }
                else {
                    colM.push({ title: k, dataIndx: k, hidden: true, editor: false });
                }

            })





            bindGridDocumentClassAssociatione(colM, response.data.Table);

        })
}


async function bindGridDocumentClassAssociatione(colM, data) {
    debugger;
    var obj = {
        numberCell: { show: false },
        minWidth: 500,
        height: 450,
        resizable: true,
        title: "Grid From JSON",
        strNoRows: 'No Rows Found',
        showBottom: false,
        scrollModel: { autoFit: true },
        postRenderInterval: -1, // To get Updated row
        trackModel: { on: true },  // To get Updated row
        colModel: colM,
        dataModel: {
            data: data,
            recIndx: primaryColumn
        },
        menuUI: {
            tabs: ['filter'] //display only filter tab.
        },
        filterModel: {
            on: true,
            mode: "AND",
            header: true,
            menuIcon: true //show filter row icon initially.
        },
    };



    $Associate_DocumentsGridPartial = $("#dvDocumentsGridPartial").pqGrid(obj);
    $("#dvDocumentsGridPartial").pqGrid("refreshDataAndView");


}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Grid Error
« Reply #1 on: April 02, 2020, 10:46:45 pm »
Could you please share a jsfiddle.

Sivakumar

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Grid Error
« Reply #2 on: April 07, 2020, 01:19:14 pm »
HI,

Below is my https://github.com/eu81273/jsfiddle-console
JS Fiddle code plz check it is not binding the data in paramquery




Thanks & regards
Geoffhayens Crhstiy

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Grid Error
« Reply #3 on: April 07, 2020, 04:41:24 pm »
That's a github url, I don't see your code.

Can you please share a live example of your issue in a jsfiddle or any other code editor so that I can check it.

Please use this jsfiddle https://jsfiddle.net/4bhu9Lza/ to set up your case.
« Last Edit: April 07, 2020, 04:48:20 pm by paramvir »