Hello I believe we have found 2 issues,
The use case we have for numbers as headers is that our users want to use “2018” as the column name. Flexmonster does not seem to auto reorder the columns any other time. We are curious if that is intended or not.
The second example for us is key because we don’t want to update every single row with the proper mapping. If you add a space to the end of each number in the second example if resolves the issue but is not ideal.
Thank you for pointing this out to us and for providing JSFiddles for illustration.
There are a few ways the desired output can be achieved:
1) By modifying the headers so that they are parsed as strings
For example, “2018 year” instead of “2018”
This way they will not be converted to a numeric type.
2) By adding
Here is a JSFiddle example for illustration.
Please let us know if this works and if you have further questions.
Thank for the information Vera but I would like to point out that your JSFiddle doesn’t really address the issue. I made one modification and change 0 to a String “Header0” and I still have the issue.
In lieu of that we’ve gone ahead and changed our implementation slightly to number the columns as shown in your original fiddle and then added the ‘caption’ and ‘uniqueName’ parameters. So the order will be guaranteed regardless of the column name.
Also Vera we found another issue with that work around please take a look at this jsFiddle https://jsfiddle.net/ha39zeum/1/
Notice when changing the type it breaks and does not display the numbers properly. The issue is resolved if you remove “uniqueName” parameter.
Thank you for your reply.
We are glad everything worked.
When the browser parses the keys, it places numeric ones in order first, then others. So, in your case, the keys will be ordered like this: 1, 2, 3, “Header0”.
An important remark is that non-numeric keys can’t be used to get values from an array. Such non-numeric keys lead to the undefined result.
We would like to note that in the JSFiddle the keys were specified as 0,1,2,… so that the order will be guaranteed regardless of the column name.
Regarding the problem when changing the type, our team looked at it in more detail and we see it is an issue.
Our team is currently working on a solution to this issue and the fix will be available in the minor release with the ETA 3rd of June.
Please let us know if you have further questions.
We are glad to announce that now it is possible to define
uniqueName property in JSON meta object for an array of arrays.
This is available in the 2.7.7 version of Flexmonster
You are welcome to update the component
Please let us know if everything works fine.
We are looking forward to hearing from you.