Author Topic: Excel workaround for leading zeros breaks header filter placeholder  (Read 1722 times)

TonyLeech

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 76
    • View Profile
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?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6173
    • View Profile
Re: Excel workaround for leading zeros breaks header filter placeholder
« Reply #1 on: September 09, 2020, 10:15:17 am »
excelformat option is a good idea, would look into it.

For now, numbers with leading "0" are treated as strings while export to Excel in upcoming version.