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.


Topics - TonyLeech

Pages: 1 [2] 3
16
Help for ParamQuery Pro / Batch Editing and Change Log
« on: May 05, 2016, 05:32:21 pm »
I'm using your Batch Editing example, but using local data instead of remote.

When I change entries in cells the 'Undo' and 'Redo' work fine so it appears that the changes are correctly tracked.  But when I press 'Get Changes' all the arrays in the console are just empty (0 length).

If I use the 'Add Button' that works fine and I can see the addList array has entries.

Also if I copy and paste data from Excel and it automatically adds new rows to the bottom of the grid then the addList array also has entries.

Why do you think I just get empty array for update/change cells even though the change tracking appears to be on and working?

I've tried changing getChanges format to 'raw' and null but neither make a difference.

I have a number column used as a recIndx like this...

   var colM = [
      { title: "", maxWidth: 30, dataIndx: "num", dataType: "number", align:"center", editable: false, hidden: false, copy: true, cls: 'ui-state-default',
         render: function( ui ){
            return "" + (1 + $("#grid_php").pqGrid('getRowIndx',{rowData: ui.rowData}).rowIndx);
         }      
      },

and...
      dataModel: { recIndx: "num", data: data },

and I use your GetChanges button from your example like this...

            { type: 'button', icon: 'ui-icon-cart', label: 'Get Changes', cls: 'changes', listener:
               { "click": function (evt, ui) {
                  var changes = grid.getChanges({ format: 'byVal' });
                  try {
                     console.log(changes);
                  }
                  catch (ex) { }
                  alert("Please see the log of changes in your browser console.");
               }
               },
               options: { disabled: true }
            },

Why are my change arrays in the console always empty?

17
Help for ParamQuery Pro / Editable Row
« on: April 15, 2016, 09:47:11 pm »
I have a table for creating and editing company stocked parts which has the PartNumber column set to 'editable: false' in the ColModel.

When the "New Part" toolbar button is clicked I use the 'grid.editCell' method to override editing and allow the user to type a new PartNumber...so normally users cannot change PartNumber, whereas they can change other existing Part parameters.

If they navigate away from PartNumber to complete remaining data entries they cannot then return to the PartNumber (in case of mistake) because the PartNumber is returned to default state of non editable. 

I can see ways to change editable state of the whole column, which I don't want to do because I don't want existing PartNumbers changed.  Is there a method to make a whole row, or specific cells, editable even after adjacent cells have been clicked/edited in the meantime?

(Currently still using version 3.2)

18
I'm trying to hide/unhide columns using your demos32 example.

                $(".columnSelector").pqSelect({
                    checkbox: true,
                    multiplePlaceholder: 'Select visible columns',
                    maxDisplay: 100,
                    width: 'auto'
                });

Unfortunately at line...

                $(".columnSelector").pqSelect({

...I get the error message...

      Object doesn't support property or method 'pqSelect'

Is there a css/js file I have to include to get the pqSelect functionality?  Perhaps you can share your full html with me so I can be sure I'm calling the <script> in the right place.

Many thanks.

19
Help for ParamQuery Pro / Is my setup correct?
« on: March 28, 2016, 06:17:06 am »
With your help on this forum I have always been able to make my grid work eventually.  But it always behaves a little differently to your demos and I am wondering if my setup is correct and am reading again your tutorial.  I am looking at your include files - (http://paramquery.com/pro/tutorial#topic-include)

<!--ParamQuery Grid css files-->
    <link rel="stylesheet" href="path to pqgrid.css" />   
 
    <!--add pqgrid.ui.css for jQueryUI theme support-->
    <link rel="stylesheet" href="path to pqgrid.ui.css" />
 
The problem I have is that I don't have a pqgrid.css file except in themes/Office.  I have instead pqgrid.min.css and pqgrid.dev.css, and so I am using pqgrid.min.css.  If this is not correct can you tell me where I can find/download the file you mention 'pqgrid.css'?

Similarly I don't have pqgrid.ui.css, but I do have pqgrid.ui.dev.css and pqgrid.ui.min.css and so I am using pqgrid.ui.min.css.  Again can you confirm if this is right or can I download the correct file somewhere?

Thanks again for your help.

20
Help for ParamQuery Pro / Export to Excel with Checkbox Column
« on: March 24, 2016, 07:58:51 pm »
I've got a column of checkboxes in my grid for row selection.  I've used the Export to Excel feature before (following your demos) and it usually works fine.  It's not working in my current grid and I'm wondering if it's because I've got this checkbox column.  I'm getting the following error "Cannot read property 'text' of null" in pqgrid.min.js.  I've tried setting copy:false in the colModel for the checkbox column but it hasn't fixed it.

Do you think I might be looking in the wrong place for my mistake?

( Still on version 3.2.0)

Thanks.

21
Help for ParamQuery Pro / Refresh Checkbox row-select column
« on: March 17, 2016, 01:50:30 am »
I have a multipage grid with a column of checkboxes for selecting the rows.  I have a header checkbox with that.

The header checkbox has been set to only select/unselect a page at a time.

After selection the user can change the filter/sort which changes the displayed rows.  The already checked/selected rows are afterwards sometimes on different pages so can be difficult to find and unselect.

So I have made a dialog box when the user 'unchecks' the header checkbox and in it I offer the choice to unselect ALL rows for entire grid, not only the visible page.  This clears the selections fully, but the checkboxes on other pages are still viewed as checked even though the row is properly unselected.  I thought that cb: select: linked the rows to the checkboxes for me...

                          cb: { header: true, all: false, select: true },

I use the following to unselect all rows with the dialog....

                  myGrid.on( "beforeCheck", function( event, ui ) {
                     if (ui.source=='header' && ui.check==false) {
                        $( "#dialog-uncheck" ).dialog({
                           resizable: false,
                           height:140,
                           modal: true,
                           buttons: {
                              "Page": function() {
                                 $( this ).dialog( "close" );
                                 $("#grid_php").pqGrid( "setSelection", {rowIndx:2} );    // this is a test and also doesn't activate row 2 checkbox
                                 $("#grid_php").pqGrid( "refreshColumn", {dataIndx: "state"} );     // this doesn't seem to refresh the checkboxes
                              },
                              "All": function() {
                                 $( this ).dialog( "close" );
                                 $("#grid_php").pqGrid( "setSelection", null );
                                 $("#grid_php").pqGrid( "refreshColumn", {dataIndx: "state"} );
                              },
                              Cancel: function() {
                                 $( this ).dialog( "close" );
                                 return false;
                              }
                           }
                        });
                     }
                       });


Can you recommend the correct way to refresh the checkbox view to match the selected/unselected rows?

Thank you in advance for your assistance.

Incidentally...still using v3.2.0 as I have a software deadline coming up and can't risk a full code update just yet.

22
Help for ParamQuery Pro / Local Sorting with float values 'undefined'
« on: March 15, 2016, 04:29:17 am »
Hi, can you tell me if is normal that local header sorting for float values doesn't work if any of the cells in that column are 'undefined', null, or text?

When I change the undefined cells to 0 or simply "" (empty) then the local header sorting works ok so I think my code is working correctly.

I should say I'm still on v3.2.0 today as I haven't made time to upgrade to your new release.

What I am doing is displaying the column as currency using the render, but the currency conversion automatically makes empty cells appear like £0.00 rather than undefined.  In my case it is important that undefined is empty or rendered as 'n/a' because it represents a stocktaking value difference, so £0.00 difference would be considered very good, whereas undefined or empty clearly shows the stocktaking is incomplete.

If this is normal operation for v3.2.0 can you tell me if the new currency feature of v3.3.0 has fixed this?

Many thanks as ever for your kind help.

Tony

23
Help for ParamQuery Pro / Help need for context of grid object
« on: March 02, 2016, 03:17:52 am »
Please help me understand where I am going wrong with the context of objects in ParamQuery.  I am trying to call an external php from a button in the toolbar.

My toolbar is created like this...
                     toolbar: {
                        cls: 'pq-toolbar-export',
                        items: [
                           {
                              type: 'button',
                              label: "Create StockDiff",
                              icon: 'ui-icon-document',
                              listeners: [{
                                 "click": function () {
                                    var grid = $(this).closest('.pq-grid');
                                    var $selArray = $("#grid_php").pqGrid( "selection", { type: 'cell', method: 'getSelection' } );
                                    if ($selArray.length == 1) {
                                       var rowData = $selArray[0].rowData;
                                       createStockDiff(grid, rowData);
                                    }
                                 }
                              }]
                           }
And then my function is like this...
                  function createStockDiff(grid, rowData) {
                     var url, type;
                     var partnumber = rowData.partnumber;
                     var mrpqty = rowData.mrpqty;
                     var talliscan = rowData.total;
                     var adjustqty = talliscan-mrpqty;
                     type = 'document';
                     url = "createstockdiff.php?pq_createhtml=1";
                     $.ajax($.extend({}, ajaxObj, {
                        context: grid,
                        url: url,
                        data: { partnumber: partnumber, count: talliscan, mrpqty: mrpqty },
                        success: function (response) {
//                           this.refreshRow({ rowIndx: rowIndx});
                        },
                        error: function () {
//                           this.refreshRow({ rowIndx: rowIndx});
                        }
                     }))
                  }

The selArray, rowData and function call activate ok, but the ajaxObj here...
                  var ajaxObj = {
                     dataType: "JSON",
                     beforeSend: function () {
                        this.showLoading();
                     },
...reports "Object doesn't support property or method 'showLoading'.

I already use the ajax process in other parts of the code so I know it is ok, but I think I am not correctly passing the grid object to my function.
Would you be able to explain why I can't pass the grid object in this way and help me to better understand how ParamQuery works? It is obvious that I don't understand it at all.

I really hope you can help.

Many thanks.  Tony.


24
Help for ParamQuery Pro / selectionModel not working with Pro v3.2.0
« on: December 29, 2015, 08:54:12 pm »
I'm using the selectionModel to get whole row selection highlight.  Although it is working fine with the eval version, when I switch to pqgrid.min.js Pro version the whole row selection stops working and I only ever get single cell selection.

In the Chrome Console I get the following error...

Uncaught TypeError: Cannot read property '0' of undefined    (at location)   pqgrid.min.js:351

Hyperlinking to the file the following part of line 351 is underlined...

g;t&&t.pq_rowselect&&b.getRow({rowIndxPage:s}).removeClass(l)}}a=d?f.dataModel.data:g;n=0;for(b=a.length;n<b;n++)if(e=a[n])e.pq_rowselect=void 0};a.isSelected=function(a){var b=

Is it likely that I have done something wrong when switching to the Pro version?  e.g. pointing to the wrong file.  Or is there a known issue with version v3.2.0 of pqgrid.min.js?

I look forward to your advice.

25
I'm finding that all my table data is being exported to excel as "String" type in the xml file...

    <Cell><Data ss:Type="String">980</Data></Cell>

I'd like columns like this one...

    { title: "Total", cls: 'bold_column', minWidth: 75, dataIndx: "total", dataType: "integer", align:"center", editable: false},

...to export as a number type for Excel.  I thought that the dataType parameter would do it but it didn't change the export.  Have I overlooked something?

Thanks.

26
Help for ParamQuery Pro / Remote filter populated from database
« on: November 28, 2015, 12:15:36 am »
I'm switching away from hard-coding my filter options {options: ['Count', 'Add', 'Subtract']} to having them populated from the database columns.  It's generally working but I find that it is always missing one entry...for example in the case of 'Count', 'Add', 'Subtract' I'm only getting 'Add' and 'Subtract' populated and 'Count' is not in my filter list.  What do you think might be wrong?

Incidentally I have today purchased the Pro Deluxe version and copied all the new JS and CSS files onto my server.  The table seems to be working ok and the 'Eval' notice has gone...but do you think I could have a mix up somewhere between old and new versions?

Thanks in advance for your help.

27
I have the same issue reported by "robgell" on the forum April 19, 2014 (04:38:06 pm).

When non-matching text is entered into the filter textboxes and correctly obtains no records the message "No rows to display" is shown.  But even after clearing all the text from the text boxes so that a full table list should be displayed (i.e. all db rows) the message "No rows to display" remains and there seems no recovery from this state except to reload the webpage.

As this is the same thing reported by "robgell" I was wondering if anyone knows what solution was implemented there because I must be missing the same thing or doing the same thing wrong.

28
I'm using several textbox filters and dropdown filters following the remote filter demo.  The dropdown filter works fine with listeners ['change'], but I can only get the textbox to work with ['keyup'] listener.  If I use the ['change'] listener on the textbox then it is only actioned once I click on another textbox in a different header.

In your demo the ['change'] listener seems to work after pressing the Enter key, mine is not triggered by the Enter key.  What do you think I might have missed?

Just to clarify - with the ['keyup'] listener on the textbox each keypress returns an updated filter from the database.

29
ParamQuery Pro Evaluation Support / Dropdown filter with default selection
« on: September 15, 2015, 04:40:22 pm »
I'm using the 'select' filter with dropdown entries supplied in colM variable like this...

options: [{transstatus:'Live', pq_selected:true},{transstatus:'Dead'}]

The 'Live' option is displayed in the dropdown by default due to the pq_selected:true, but the table doesn't filter 'Live' by default when initialized.  Is there another setting/option required to enforce the pq_selected action on the table not only in the header?  I can confirm that the selector is working and properly selects 'Live' if manually changed to 'Dead' then returned to 'Live'.

Thanks in advance.

Tony

30
ParamQuery Pro Evaluation Support / Remote filtering and remote paging
« on: September 14, 2015, 08:22:35 pm »
Is it possible for remote filtering and remote paging combined at the same time?

I have remote filtering working, and independently I have remote paging working.  Now I have combined them the filtering part no longer works.  When I enter text into the filters the 'Loading' progress dialog flashes up but the resulting page is simply unfiltered normal rPP.  There doesn't seem to be a demo combining all the various methods to demonstrate how to stitch all options together, so I'm simply assuming they should all work together if required.

Any guidance would be appreciated.

Thanks,

Tony

Pages: 1 [2] 3