Hi Irvin,
Thanks for using Syncfusion Products.
Based on your requirement we have created the sample.
Sample: forum118555.zip
Please find the response for your queries.
I need to know what are the supported values that can be set in the format option of the grid column ( {0:...} ) My requirement is to display some data in the grid in various formats | We have used the Globalize format in our Grid. So all Globalize scripts supports format will be supported in our Grid. Please find the below code snippet for various formats in Grid.
Please refer the online demo in following link. | ||
display a number with a defined number of integer and decimal places like 10.000,50 that is coming from the datasource as 10000.5 | Your requirement is achieved by using the “locale” property in Grid. And also please refer the following script files in your application.
Please find the below code snippet.
| ||
display a time like 10:28 that is coming from the datasource as 1028 display a period like 10/2015 that is coming from the datasource as 102015 display a period like 10/2015 that is coming from the datasource as 102015 | For your kind information, the mentioned format have not supported in the Globalize format if the datasource value as numeric like you mentioned. So we have achieved by using the “column template” in Grid and the format applied by using the jsrender. Please find the below code snippet.
|
Please let us know If you have any queries.
Regards,
Balaji Marimuthu
{{>~TimeFormat(Time)}}
{{>~TimeFormat(<cellcontent>)}}
Hi Irvin,
Thanks for the update,
Query 1 : “What is the best approach?”
If we use queryCellInfo method the performance will be low. So in previous response we suggest you to use column template. But in column template we unable to perform the sorting, filtering operations. So we suggest you the queryCellInfo method.
In ejGrid when we enable sorting it will defaultly sort according to the column data type in column. So, we need not to handle anything externally.
Query 2 : “{{>~TimeFormat(<cellcontent>)}}”
In column template we have to specify template for each column is to be render as column template. So, we unable to specify as a generic one
If we misunderstand any queries, please kindly get back to us we will be happy to assist you,
Regards,
Prasanna Kumar N.S.V
Hi Irvin,
Thanks for the update.
Please get back to us if you need any further assistance.
Regards,
Balaji Marimuthu