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

Pages: 1 2 [3] 4 5 6
31
Help for ParamQuery Pro / <ctrl>-click cell selection
« on: May 09, 2016, 01:35:07 am »
I'm sure I must be missing something obvious...

When I'm in 'row' mode for selection the <ctrl>-leftclick will select multiple rows in any sequence.  But in 'cell' mode the <ctrl>-leftclick only ever selects one cell at a time.  Am I missing something in the setup?  Or is this a feature in 3.3.0 which I still haven't upgraded to yet?

Many thanks.

32
Help for ParamQuery Pro / Re: Batch Editing and Change Log
« on: May 05, 2016, 09:29:46 pm »
* UPDATE *

If I initialise the 'num' column with values 1-10 I get 10 empty grid rows to use for recIndx and gives a nice space for my users to paste into.  That seems to work quite well and gives update arrays when contents are pasted in, and addList array if the pasted rows are more than 10 rows (the grid automatically expands to accept the extra rows).  But the update rows have a red triangle and the addList rows don't.  Can I switch off the red triangle from the update rows so that all rows look the same?

But I don't think the extra rows are filling numbers into my 'num' column.  So I would still be interested how to automatically add digits to my 'num' column when additional rows are pasted in.

33
Help for ParamQuery Pro / Re: Batch Editing and Change Log
« on: May 05, 2016, 09:21:57 pm »
Yes, through trial and error I found the same thing...

The 'num' column that I'm using for recIndx was originally empty and being rendered automatically to appear like an incrementing row number.  This means that the recIndx cannot work with this column.  I copied the autoincrement render from another forum post/reply that I found here.

Can you tell me how I would automatically add an actual number to the column so that it can be used for recIndx?  This would need to add/update the column whenever data is pasted in from Excel.

I tried using my 'partnumber' colum as the recIndx instead which worked ok when I typed changes into the cells...and I got the arrays from getChanges.  But when I pasted cells that I'd copied from Excel these changes were not available from getChanges and again returned 0 length.

34
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?

35
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)

36
Help for ParamQuery Pro / Re: Export to Excel with Checkbox Column
« on: March 28, 2016, 11:15:42 pm »
I've been able to narrow it down, but I can't see the specific data type which is causing it to fail.  How it comes about is like this...

I am using a remote database to fill the grid. 

If I fill the grid with 'good' data where all entries seem to be string, integer, and even 'undefined' the Excel export works fine.

But if I use a 'left outer join' which populates all the data from a 'master' table and only some of the grid cells receive matching data from the 'subtable' I think the export function doesn't like the format of some (or all) of the empty grid cells.  In this event it will not export to Excel and throws the error mentioned in the original post. 

I don't know whether the empty grid cells are 'null', empty string, empty string where integer is expected or whatever, but if I apply a filter after the data is loaded so that all the empty cells are removed then it will export to Excel once again.

I will experiment to try to determine which datatype is in the empty cells and causes the fault, but it would also be helpful if you can identify from your source code what sort of datatype would cause your export function to fail.  Hopefully we can the draw the same conclusion.

I hope this extra description is useful.

37
Thank you.  I feel dumb for not looking back at those folders...I spent all the time looking to spot something on your demos, jsfiddles and APIs, and just couldn't see what I was missing.

As ever you have got me up and running again.

38
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.

39
Help for ParamQuery Pro / Re: Is my setup correct?
« on: March 28, 2016, 02:35:40 pm »
Ok.  Thank you for the confirmation.  That makes me more confident to investigate some of the ways I create and use objects in my code which is probably the cause of the differences I see.

Many thanks.

40
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.

41
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.

42
Help for ParamQuery Pro / Re: Refresh Checkbox row-select column
« on: March 24, 2016, 07:46:37 pm »
Excellent.  Thanks.  That worked.

43
Help for ParamQuery Pro / Re: Refresh Checkbox row-select column
« on: March 22, 2016, 06:23:12 pm »
Thanks, how do I alter the checkbox state programatically?  I guess I could read the selection array before clearing the affected checkboxes.

Incidentally I did start with cb.all=true, but I found that I kept forgetting that all other pages were being selected and not just the 50 I was looking at (i.e. my page size was 50).

Alternatively can I change cb.all to true on-the-fly using 'beforeCheck' as the trigger? And then return it to cb.all = false afterwards?

Thanks again.

Tony

44
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.

45
That's good.  Thank you for confirming that my null values are as expected in v3.2.0.  I will try your jsfiddles in my code, and realise that I should upgrade to v3.3.0 as soon as possible.  I will confirm the fix once all changes and upgrades are in place (however I will be out of the office for a couple of days).  I believe your support will fix it.

Your support, as ever, is excellent.

Best regards.

Pages: 1 2 [3] 4 5 6