Replies
That's certainly weird. I referenced
Hello,
I think the issue is that the string you provide for the second param of addSvgIconFromText (coming from the FA icon) is just the path, while the funcion expects the full svg string, including the viewBox (as we don’t have any way to assume it for custom icons).
I am attaching a sample that uses a svg template that these values are replaced in. It works for the coffee icon that I tried with but I can’t be sure if you will be able to use it without changes for each of the icons you need. If you have any issues with that, you may consider using their fa-icon component as it is built from the ground up to work with the fa svg icons.
Thank you for using Infragistics forums! Please, let me know if I can help you further!
Best regards,
Stamen Stoychev
Attachments:
Hello Tapas,
You could check if my previous suggestion is the cause of the issue by executing the following in your browser console when the grid is loaded:
$(“#csagrid”).data(‘igGrid’).dataSource.dataView()[0][“ENTRY_DATE”]
If the value returned is a string, then it would make sense that it is exported as NaN in Excel. If this is the case, we’ll have to figure out why your date column doesn’t transform the strings coming from the server to JavaScript Date objects. You could try explicitly setting localSchemaTransform to true in your grid initialization code or observe the network tab in your browser developer tools to see the response you get when data binding. What are the values that come for the column ‘ENTRY_DATE’?
I am also attaching a sample I created to see if I can reproduce this. The only NaN value that is shown in the Excel file for my sample is the first row’s one which I deliberately made impossible to parse as a Date.
Best regards,
Stamen Stoychev
Hello Tapas,
For this date column to be exported as NaN in Excel, my guess is that its values in the grid's data source remain strings instead of getting converted to JavaScript Date objects. This can happen either because the server serialized values are not parsable by the browser (unlikely given the screenshot you provided) or because you set localSchemaTransform to false somewhere in your grid initialization code. Could you please check if this is the case and let me know.
Best regards,
Stamen Stoychev
Hello Tapas,
It's hard to say what could be going wrong in this case based on the screenshots alone. In our Export to Excel sample we show a date column that is correctly exported. Could you please share a sample that reproduces the behavior that I could look at? Or check our sample for any differences that may result in this behavior.
I am looking forward to your reply. Thank you for using Infragistics forums!
Best regards,
Stamen Stoychev
Hello Maria,
Unfortunately, the grid doesn't pass that. If you have a single formatter function for multiple columns you could assign (as their formatters) anonymous functions that call the actual formatter one with the additional argument of that column's key.
Best regards,
Stamen Stoychev
Hello Maria,
This might be the case if you are using an older version but in recent ones the formatter receives both the value and the whole record (as shown in the code snippet here). The template is also executed against the whole record so you can reference other properties from inside.
Best regards,
Stamen Stoychev