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
1
Bug Report / Header filter value disappears for currency format 0
« on: March 15, 2021, 06:57:34 pm »
With a currency column format like this

{ title: "Value ", align: "center", dataIndx: "value", dataType: "float", editable: false, hidden: false, format: "#.00", filter: { crules: [{condition: 'between'}]} }

If you enter 0 in the left filter box (so any values greater than 0 are listed) a grid refresh causes the left filter box to appear empty although the 0 is still being applied.

I have confirmed this on your own demo https://paramquery.com/pro/demos/filter_header after adding currency format in your freight column and changing filter to 'in between'.

If another value, like 1, is entered into the left filter box, the filter box correctly displays 1.00 even after a refresh.  Also if 0 is entered into the right-side filter box the entry is correctly displayed as 0.00 and does not disappear following a refresh.

The above problem also occurs for the filter type 'greater than'.

Do you have a workaround until this bug is fixed?

2
Bug Report / Export to Excel with Nesting colModel
« on: October 09, 2020, 01:38:20 am »
Part of my grid uses a nested colModel like

Code: [Select]
{ title: "Physical Difference", minWidth: 120, align: "center", colModel: [
{ title: "Quantity", minWidth: 80, align: "center", dataIndx: "diffqty", dataType: "integer", editable: false, hidden: true,
filter: { crules: [{condition: 'between'}]},
},
{ title: "Value ", minWidth: 80, align: "center", dataIndx: "diffval", dataType: "float", editable: false, hidden: false, format: "#.00",
filter: { crules: [{condition: 'between'}]},
}
]},

When I export the whole grid to Excel the column headers are out of line with the data columns and I find the 'details' icon is exported as the first column like this...

Code: [Select]
<div class='ui-icon ui-icon-triangle-1-e glyphicon glyphicon-plus'></div>
... even though the details column is marked with 'copy: false'

Code: [Select]
{ title: "", minWidth: 27, maxWidth: 27, type: "detail", resizable: false, copy: false, editable: false, menuIcon: false, menuInHide: true },

Is this a bug?  Is there a workaround?  Have I missed something in the colModel api?

Many thanks for your assistance.

Regards, Tony

3
I've been using the standard header filter for a long time with a listener to convert from a datepicker to a millisecond timestamp.

Code: [Select]
{ title: "Oldest Count", minWidth: 175, dataIndx: "oldestcount", align:"center", editable: false, dataType:"integer",
render: formatDate,
filter: { crules: [{condition: "between"}],
init: uiDatePicker,
listeners: [{ 'change': function(evt, ui) {
ui.value = millisecondsFromShortDate(ui.value);
ui.value2 = millisecondsFromShortDate(ui.value2);
$(evt.target).closest(".pq-grid").pqGrid('filter', {
oper: "add",
rules: [ui]
})
}}]
}
}

When I use the datepicker in the MenuUI filter the colModel filter listener does not trigger.  Is there a listener for the MenuUI filter?  Alternatively, can you advise how I can intercept the MenuUI filter to convert the datepicker into a millisecond timestamp before the remote request is triggered by the filter?

Thanks in advance.

4
Hello, my Excel export requires company part numbers formatted as text so that Excel keeps the leading zeros in the company part numbers.  I notice that when using your workaround code...

Code: [Select]
format: function(val){
return " "+val;
},

... that it is not compatible with column filter with a placeholder in the attribute...

Code: [Select]
filter: {  attr: 'placeholder = "search..."', crules: [{condition: 'contain'}]}
I have tested it on your demo for remote header filter  https://paramquery.com/pro/demos/filter_header  and it recreates the same problem.

The problem is that the format introduces a 'space' character into the filter textbox which automatically replaces the placeholder text.

In order to be able to avoid using workaround fixes for Excel export will you be able to introduce an "excelformat" option into the colModel to take standard Excel formatting types "Text", "Number", "Accounting", "Scientific", etc?  Or perhaps simply use the colModel dataType to tell Excel that string=text and float=numeric?

5
Help for ParamQuery Pro / Merge Data from two Remote Sources
« on: November 17, 2017, 09:07:36 pm »
I'm sorry I'm about to ask a really lazy question...

The data for my grid is coming from two remote sources, each providing data in json suitable for dataModel.data.  The first source populates the left side of my grid and the second source populates further detail on the right side of the grid.  The sources share a common data element which I use in the first column.

Do you have any method in your grid functions which automatically merges two json sources that share a common data element such as "id", or must I loop through each row, finding a match then merging using something like .extend?

Many thanks.  Again, sorry for asking such a lazy question  :-[

6
Bug Report / Problem after export to Excel
« on: April 07, 2017, 02:02:53 am »
After exporting a grid to Excel (version 3.3.2) the Excel file opens up ok with the correct columns and all my data.  The data is all in a single Excel worksheet tab and there are no other tabs.  When I click to add a new tab I get the following error message in Excel "That command cannot be used on multiple selections."

Can you confirm that you observe the same issue?  If so, do you know why it is doing that?  Google suggests that there is corruption in the file, but I have not modified the file since it was exported from ParamGrid.

This is the code I use to export the Excel file...

Code: [Select]
{ type: 'separator' },
{
type: 'select',
label: 'Format: ',               
attr: 'id="export_format"',
options: [{ xlsx: 'Excel', csv: 'Csv', htm: 'Html', json: 'Json'}]
},
{
type: 'button',
label: "Export",
icon: 'ui-icon-arrowthickstop-1-s',
listener: function () {
pageModel.type = 'local';
this.option( "pageModel", pageModel);
this.refreshDataAndView();
this.one('load', function() {
var format = $("#export_format").val(),                           
blob = this.exportData({
//url: "/pro/demos/exportData",
format: format,                               
render: true
});
if(typeof blob === "string"){                           
blob = new Blob([blob]);
}
saveAs(blob, "Transactions."+ format );
pageModel.type = pageModelType;
this.option( "pageModel", pageModel);
this.refreshDataAndView();
});
}
},

Many thanks for your assistance.

Tony

7
Help for ParamQuery Pro / columnSelector in detail grid (child)
« on: January 17, 2017, 01:14:56 am »
I'm using the pqSelect style column selector in a child grid the same as I would for the mainGrid.  Each time the child grid is expanded the new class "detailcolumnSelector" works fine and the detail grid 'load' event sets up the entries and the pqSelect conversion.  My problem is that when I then open a second detail grid the first detailGrid loses the column options from the selector, and the second detail grid column Selector now works instead.  So every new details grid works fine, but the old and still open grids lose the column selector functionality.

I thought that as they all share the same class "detailcolumnSelector", and the fact they all share the same colModel structure as well, that all instances of the class would act simultaneously...but instead only the latest opened detailGrid operates correctly whilst the old ones stop working.

I don't know if I've given you enough to work with here, but do you know if what I'm trying to do is even possible?  Do you have any samples of grids with rows of details grids that use the column selector within the details grids?

Many thanks in advance.

8
Help for ParamQuery Pro / Switch to local pageModel for Excel Export
« on: December 09, 2016, 08:47:35 pm »
Normally I use 'remote' type for pageModel so I reduce the amount of data traffic to load into each page.  But when the customer wants to export to Excel only the current page view is exported (e.g. 50 rows).  To work around this I have page options dropdown selector for up to 1000 rows, but it is still not very convenient.

I am trying to switch temporarily to pageModel type: 'local' just before the Excel export, refresh the grid to load all rows from the remote database, and then switch back to pageModel type: 'remote' for normal operation again.

I have tried...

Code: [Select]

        myGrid.on("beforeExport", function (evt, ui) {
pageModel.type = 'local';
this.option( "pageModel", pageModel);
this.refreshDataAndView();
});

myGrid.on("exportData", function (evt, ui) {
pageModel.type = pageModelType;    //pageModelType is just a variable set to 'remote'
this.option( "pageModel", pageModel);
this.refreshDataAndView();
});

...but the exported data is still just 50 rows instead of 50000.  Do I need to apply code for a listener for the grid data to be refreshed following the "beforeExport" event?

Can you guide me please?

9
Help for ParamQuery Pro / Icon-only Button in Toolbar
« on: November 30, 2016, 12:57:26 am »
I'm trying to save space on the toolbar by using buttons with an icon only, i.e. without the text label.  By default this results in a very thin button, only 8 pixels tall because of the 4 pixel dimension of the curved corners.

I've tried changing various properties (e.g. height) using 'style', and I've tried implementing a new 'cls', but I'm not having any luck.  Finally I tried using 'ui-button-icon-only' from Jquery UI but I couldn't get that to change anything either.

Can you help?  Many thanks.

10
I'm finally getting round to updating to version 3.3 and using the improved Excel export features, but I may have spotted a bug.

With this grid column model...

   var colDetail = [
      { title: "pick_part_id", minWidth: 75, maxWidth: 100, dataType: "integer", dataIndx: "pick_parts_id", resizable: false, copy: false, editable: false, hidden: true },
      { title: "picklist_id", minWidth: 75, maxWidth: 100, dataType: "integer", dataIndx: "picklist_id", resizable: false, copy: false, editable: true, hidden: true },
      { title: "Part Number", cls: 'bold_column', minWidth: 250, dataIndx: "partnumber", editable: true },
      { title: "Part Name", cls: 'bold_column', minWidth: 300, dataIndx: "partname", editable: false },
      { title: "Qty Per", minWidth: 100, dataType: "integer", dataIndx: "pickqtyper", align:"center", editable: true },
      { title: "Last Modified", minWidth: 175, dataIndx: "pick_parts_modified", align:"center", editable: false, dataType:"date" }
   ];

... I get four columns exported, which is fine because the first two column definitions have "copy: false".  However Excel hides its first two of the four (partnumber and partname) because it's taking the "hidden: true" definition from my non-copied columns (pick_part_id and picklist_id).  I've tested this two ways so far, first by setting 'hidden:false' on the picklist_id and then Excel only hides partnumber; and second I modified your "Local Export" demo http://paramquery.com/pro/demos/export_local adding

            { title: "Hidden Data", width: 130, dataIndx: "HiddenData", copy: false, hidden: true },
 
at the top of your definition.  With this changed, and then export to Excel, Excel hides the ContactName column.

Assuming I'm not simply doing something wrong...can you offer a workaround for this?

Many thanks.

Tony

11
Help for ParamQuery Pro / Grid Toolbar Button to Select/Load Local File
« on: September 07, 2016, 05:30:03 pm »
I'd like to use a button on the grid toolbar to load a local file into the grid.  Most of the jQuery examples I've found still use an html <input type="file"> and respond to or trigger its click event.  Do you know instead if I can use one of your buttons placed on the grid toolbar?

Alternatively, have you done this before and have a solution you can share?

Much appreciate any support/ideas you can offer.  Thanks.

12
Help for ParamQuery Pro / Combining Remote and Local Filter
« on: July 27, 2016, 08:35:24 pm »
I currently use remote data, remote sort and remote filter.  All works fine.

I now have a new column that I need to filter locally once the remote data is displayed on grid.  The reason this column needs a local filter is that it would otherwise change the whole dataset and upset some calculations if the data is actively removed...I just want to able to filter the grid results without affecting the rest of the row.

I read one of your other forum responses which suggested switching to local filter temporarily and then reverting back to remote after the local filter had been applied.  Is this the best/only approach or can I set an individual column to be a local filter only?  Either way I'm not really sure how to do it.

Hope you can help.

Regards, Tony.

13
Bug Report / Strange Behaviour in Edit Cell with Internet Explorer
« on: July 25, 2016, 02:47:25 pm »
I use inline editing like your "Batch Editing" example.  It works fine but I have an odd behaviour in IE11 that I hope you can help with.

When I double click on the cell it activates the text box for editing, but in Internet Explorer if I move the mouse away from the cell the cursor jumps out of the cell and appears in the extreme top left of the grid.  I don't see this behaviour in Chrome which works perfectly.

I guess this must be a css parameter that I've got wrong somewhere...perhaps something to do with 'hover' but I don't really know where to look.  What should I be looking for to change css parameters related to edittext boxes and probably pqselect.

Any pointers would be greatly appreciated.

Many thanks.

14
Help for ParamQuery Pro / Angle Brackets being removed
« on: July 12, 2016, 02:58:20 pm »
I'm testing for special characters today to find out what needs to be escaped or url encoded, but I don't know how to handle what I found.

If I include angle brackets in a cell then the displayed content of the cell changes.

Example 1: If I put a tag-style word into a grid cell then it disappears from the display altogether.  Although the full word still exists and is sent/received by JSON to the database.  Try putting this text into a grid cell to see what I mean - "Enter this <text> like this".  If you put that small phrase into a grid cell you notice that the <text> word disappears from display altogether.

Example 2: If I put a lt sign (<) into a grid cell followed directly by more text then all the subsequent text vanishes.  Try putting this text into a grid cell to see what I mean - "Enter this <text into cell".  If you put that small phrase into a grid cell you notice that everything to the right of the < sign is removed leaving only "Enter this ".

You can try both of these examples in your own batch editing demos.

Can you explain to me what is actually happening with these examples and suggest where I can add an escape character or other encoding to make sure all text is displayed?

Many thanks for your help

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

Pages: [1] 2 3