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

Pages: [1]
1
Here is my code

           var dateEditor = function (ui) {
                var $cell = ui.$cell,
                    rowData = ui.rowData,
                    dataIndx = ui.dataIndx,
                    cls = ui.cls,
                    dc = $.trim(rowData[dataIndx]);
                $cell.css('padding', '0');
                var $inp = $("<input type='text' id='" + dataIndx + "' name='" + dataIndx + "' class='" + cls + " pq-date-editor' style='position: relative; z-index: 100;border: 3px solid rgba(0,0,0,0);'/>")
                .appendTo($cell)
                .val(dc).datepicker({
                    changeMonth: true,
                    changeYear: true,
                    dateFormat:"dd/mm/yy",
                    onClose: function () {
                        $inp.focus();
                    }
                });
            }
 

{ title: "Date", dataIndx: "date", width: 150, align: "center", dataType: "date", resizable: false
                  ,render: function (ui) {
                      if (ui.cellData==null)
                      {
                          return '';
                      }
                      else
                      {
                          console.log(ui.cellData);
                          var date = new Date(ui.cellData);
                          var xdd = date.getDate();
                          var xmm = (date.getMonth() + 1);
                          var xyy = date.getFullYear();
                     
                          if (parseInt(xdd)<10){xdd='0'+xdd;}
                          if (parseInt(xmm)<10){xmm='0'+xmm;}
                     
                          return xdd + '/' + xmm + '/' +  xyy;
                      }
                  }
               ,editor: {type: dateEditor}
                         },

2
Help for ParamQuery Pro / Error While Initializing two Group By Grid
« on: February 13, 2019, 07:27:43 pm »
pqgrid.min.js:16 Uncaught TypeError: Cannot read property 'length' of undefined
    at Function.shiftRC (pqgrid.min.js:16)
    at _pq.cFormulas.onDataReadyDone (pqgrid.min.js:17)
    at t.(anonymous function).(anonymous function).<anonymous> (http://localhost:63220/PqGridPro/pqgrid.min.js:16:30897)
    at o (pqgrid.min.js:9)
    at t.(anonymous function).(anonymous function).i._trigger (http://localhost:63220/PqGridPro/pqgrid.min.js:9:7633)
    at t.(anonymous function).(anonymous function).a.refreshDataFromDataModel (http://localhost:63220/PqGridPro/pqgrid.min.js:10:17779)
    at t.(anonymous function).(anonymous function).a.refreshView (http://localhost:63220/PqGridPro/pqgrid.min.js:10:21420)
    at t.(anonymous function).(anonymous function).o._onDataAvailable (http://localhost:63220/PqGridPro/pqgrid.min.js:12:25801)
    at t.(anonymous function).(anonymous function).a.refreshDataAndView (http://localhost:63220/PqGridPro/pqgrid.min.js:10:22059)
    at t.(anonymous function).(anonymous function).r._create (http://localhost:63220/PqGridPro/pqgrid.min.js:12:18558)
shiftRC @ pqgrid.min.js:16
onDataReadyDone @ pqgrid.min.js:17
(anonymous) @ pqgrid.min.js:16
o @ pqgrid.min.js:9
i._trigger @ pqgrid.min.js:9
a.refreshDataFromDataModel @ pqgrid.min.js:10
a.refreshView @ pqgrid.min.js:10
o._onDataAvailable @ pqgrid.min.js:12
a.refreshDataAndView @ pqgrid.min.js:10
r._create @ pqgrid.min.js:12
(anonymous) @ jquery-ui.min.js:7
_createWidget @ jquery-ui.min.js:7
t.(anonymous function).(anonymous function) @ jquery-ui.min.js:7
(anonymous) @ jquery-ui.min.js:7
each @ jquery.min.js:2
each @ jquery.min.js:2
t.fn.(anonymous function) @ jquery-ui.min.js:7
i.grid @ pqgrid.min.js:12
SalesGrid @ home:600
(anonymous) @ home:902


pqgrid.min.js:16 Uncaught TypeError: Cannot read property 'length' of undefined
    at Function.shiftRC (pqgrid.min.js:16)
    at _pq.cFormulas.onDataReadyDone (pqgrid.min.js:17)
    at t.(anonymous function).(anonymous function).<anonymous> (http://localhost:63220/PqGridPro/pqgrid.min.js:16:30897)
    at o (pqgrid.min.js:9)
    at t.(anonymous function).(anonymous function).i._trigger (http://localhost:63220/PqGridPro/pqgrid.min.js:9:7633)
    at t.(anonymous function).(anonymous function).a.refreshDataFromDataModel (http://localhost:63220/PqGridPro/pqgrid.min.js:10:17779)
    at t.(anonymous function).(anonymous function).a.refreshView (http://localhost:63220/PqGridPro/pqgrid.min.js:10:21420)
    at t.(anonymous function).(anonymous function).o._onDataAvailable (http://localhost:63220/PqGridPro/pqgrid.min.js:12:25801)
    at t.(anonymous function).(anonymous function).a.refreshDataAndView (http://localhost:63220/PqGridPro/pqgrid.min.js:10:22059)
    at t.(anonymous function).(anonymous function).r._create (http://localhost:63220/PqGridPro/pqgrid.min.js:12:18558)

3
Help for ParamQuery Pro / Pivot Grid Export to Excel Problem
« on: December 18, 2018, 01:59:37 pm »
Hello, I am getting this error while exporting the pivot grid.
drreport:1526 Uncaught ReferenceError: saveAs is not defined
    at e.(anonymous function).(anonymous function).listener (http://localhost:63220/report/drreport:1526:29)
    at HTMLButtonElement.<anonymous> (pqgrid.min.js:13)
    at HTMLButtonElement.dispatch (jquery.min.js:3)
    at HTMLButtonElement.r.handle (jquery.min.js:3)

And My code is.
{
                        type: 'button',
                        label: "Export to Excel(xlsx)",
                        icon: 'ui-icon-document',
                        listener: function (evt) {
                            var str = this.exportExcel({ render: true });
                            saveAs(str, "pivot.xlsx");
                        }
                    },

4
Help for ParamQuery Pro / Re: Unable To Use File Upload In Pro Version
« on: December 07, 2018, 05:46:18 pm »
Thanks It worked fine  :)

5
Help for ParamQuery Pro / Unable To Use File Upload In Pro Version
« on: December 07, 2018, 03:18:18 pm »
Hi ,
We are using latest Pro version Of PQGrid and wanted to use the file upload functionality with reference to the following  jsfiddle
http://jsfiddle.net/Dalvi1988/vgjeodxc/

The problem am facing is in the bellow code is
-------------------------------------------------

 refresh: function(event, ui) {
                    $("#workingFile_papers").find("input.file").button().bind("change", function (evt){
                        debugger;
                        var $tr = $(this).closest("tr");
                        var objs = $grid.pqGrid("getRowIndx", { $tr: $tr }).rowIndx;
                        //var rowIndx = obj.rowIndx;
                        var clone = $(this).clone();
                        var rowData = $grid.pqGrid("getRowData", { rowIndx: objs })
                        //rowData.file=clone;
                        rowData.file=clone;
                        /*  clone.attr('id', 'field2');*/
                        // $('#headerToolbar').html(clone.attr('id', 'file'));
                    }); 
            }

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

 var objs = $grid.pqGrid("getRowIndx", { $tr: $tr }).rowIndx; am getting  rowIndx as UNDEFINED

more over in the following snippet : var rowData = $grid.pqGrid("getRowData", { rowIndx: objs })
we are getting file as undefined .

if we happened to insert    { rowIndx: objs } as { rowIndx: 0 } as  hard coded the Zero row value
we are getting UNDEFINED in the place of file object if we happened to console
  rowData

hence unable to get it used.

This is working fine in the jsfiddle as it seems due to version issue we aren't able to use the same code snippet from the jsfiddle

here is the code we are using: - 



    $(function() {
        var data =[{"id":1,"file":"","working_paper_code_id":"72","working_paper_code":"222dddd","document":"dqwdq2d","mandatory":"NO","task_wp_id":"11","remarks":"REst wp updated 9"}] ;
        var obj = {
           scrollModel: {autoFit: true},
            numberCell: {resizable: true,title: "Sr No"},
            menuIcon: true,
            title: "WORKING PAPERS",
            height: 'flex',
            width: '100%',
            rowHt: 22,
            resizable: true,
            columnBorders: true,
            collapsible: {toggle: false,on: false},
            validation: {icon: 'ui-icon-info'},
            trackModel : { on: true },
            track: true,
            selectionModel: { type: '' },
            hoverMode: 'cell',
            editModel: { saveKey: $.ui.keyCode.ENTER },
            colModel: [
                        {
                            title: "ID",
                            dataIndx: "id",
                            dataType: "integer",
                            editable: false,
                            hidden: true
                        },
                        {
                            title: "task_wp_id",
                            dataIndx: "task_wp_id",
                            dataType: "string",
                            hidden: true
                        },
                        {
                            title: "Working Paper Code",
                            dataType: "string",
                            dataIndx: "working_paper_code",
                            filter: {
                                crules: [{
                                    condition: 'contain'
                                }]
                            },
                            width: '20%',
                            editable:false,
                            align: "left",
                            halign: "left",

                        },
                        {
                            title: "Working Papers Code ID",
                            dataIndx: "working_paper_code_id",
                            dataType: "string",
                            hidden: true
                        },
                        {   title: "Document",
                            dataType: "string",
                            dataIndx: "document",
                            editable:false,
                            filter: {crules: [{ condition: 'range' }]},
                            width: '25%',
                            align: "left",
                            halign: "left"
                         },                   
                            {
                                title: "Mandatory", width: '15%', align: "center", resizable: false,editable:false,align: "center",dataIndx: "mandatory",type: 'checkbox',
                                cb: {
                                    all: false, //header checkbox to affect checkboxes on all pages.
                                    header: true, //for header checkbox.
                                    check: "YES", //check the checkbox when cell value is "YES".
                                    uncheck: "NO" //uncheck when "NO".
                                },
                                renderLabel: function(ui) {
                                    var cb = ui.column.cb,
                                        cellData = ui.cellData,
                                        disabled = this.isEditableCell(ui) ? "" : "disabled",
                                        text = cb.check === cellData ? '' : (cb.uncheck === cellData ? '' : '');
                                    return text;
                                },
                                 editor: false,
                                 useLabel: true
                             },
                            { title: "Remarks", dataType: "string", dataIndx: "remarks",  filter: {crules: [{condition: 'range'}]}, width: '25%', align: "left", halign: "left"},
                            //{ title: "Upload", dataIndx: "file",editable:false, sortable: false, minWidth: '15%', align: "center",
                             //   render: function (ui) {
                              //      return "<input type='file' class='file' accept='image/jpeg,image/png' />";
                               // }               
                               
                            //}
                            { title: "File", editable: false, minWidth: 200, dataIndx: "file", sortable: false,
                                halign:"center",
                                render: function(ui) {
                                    return "<input type='file' class='file ui-button ui-widget ui-state-default ui-corner-all ui-state-focus' role='button' aria-disabled='false'>";
                                }
                            },

            ],
             
             
            filterModel: {
                on: true,
                mode: "AND",
                header: true,
                menuIcon: true //show filter row icon initially.
            },
            menuIcon: true, 
            menuUI: {tabs: ['filter']},
            dataModel: {
                data: data,
                location: "local",
                recIndex: "id"
            },
            quitEditMode: function(evt, ui) {
                if (evt.keyCode != $.ui.keyCode.ESCAPE) {
                    $grid.pqGrid("saveEditCell");
                }
            },
            refresh: function(event, ui) {
                    $("#workingFile_papers").find("input.file").button().bind("change", function (evt){
                        debugger;
                        var $tr = $(this).closest("tr");
                        var objs = $grid.pqGrid("getRowIndx", { $tr: $tr }).rowIndx;
                        //var rowIndx = obj.rowIndx;
                        var clone = $(this).clone();
                        var rowData = $grid.pqGrid("getRowData", { rowIndx: objs })
                        //rowData.file=clone;
                        rowData.file=clone;
                        /*  clone.attr('id', 'field2');*/
                        // $('#headerToolbar').html(clone.attr('id', 'file'));
                    }); 
            },
    cellBeforeSave: function(evt, ui) {
      var isValid = grid.isValid(ui);
      if (!isValid.valid) {
        evt.preventDefault();
        return false;
      }
    }
        };
        var $grid = $("#workingFile_papers").pqGrid(obj);
    });

6
 render: function(ui) {
                            if (!ui.other) {
                                if(ui.cellData != undefined){
                                        return '<span title=\'' + ui.cellData.replace(/\n/g,"&#013;") + '\'>' + ui.cellData + '</span>';
                                }
                            }
                        }

There is a slight change in the code provided by you. And it is Working fine.

7
thanks a lot.

8
render: function(ui) {
                        if (!ui.other) {
                            if(ui.rowData[ui.dataIndx] != undefined){
                            return '<span title=\'' + ui.rowData[ui.dataIndx] + '\'>' + ui.rowData[ui.dataIndx] + '</span>';
                            }
                        }
                    }

9
Help for ParamQuery Pro / multiline text in cell showing <br> on cell hover
« on: November 19, 2018, 06:08:48 pm »
multiline text in cell showing <br> on cell hover mode. We have used render function for hovering on cell text.

Thanks
Aditya

10
Hi,
We are using Pro version of pqGrid. We are using exportData() for all our grid exports. In the case of Excel export option for exportData(), the sheetName property is not working.


Thanks
Aditya

11
Bug Report / Re: numberCell title property not working
« on: November 16, 2018, 06:33:26 pm »
Hi,
We are using "numberCell", { resizable: true, title: "Sr No" } but title is not showing up in this case. we are using Pro version of the ParamQuery Grid.
But in the basic version of it , it was working fine.

Thanks
Ankush.

12
Bug Report / numberCell title property not working
« on: October 31, 2018, 01:43:33 pm »
Hi,
We are using "numberCell", { resizable: true, title: "Sr No" } but title is showing up in this case. we are using Pro version of the ParamQuery Grid.
But in the basic version of it , it was working fine.

Thanks
Ankush.

Pages: [1]