| Wijmo Team Member | AlexPaterson posted on June 4, 2012 at 8:09 am Hi everybody.
And using this to make it a wijmo grid : $(“#tabella”).wijgrid({ }); The problem is : Is there a possibility to : - Read dates in a format but showing them in another one Thanks ! | ||||||||||||||||||||||||||
| Wijmo Team Member | sergeys posted on June 5, 2012 at 2:44 am The fix for this issue will be available in the next release.
Globalize.cultures['default'].calendar.patterns['d'] = ‘yyyy-MM-dd’;
Filter may work incorrectly due to non-zero time portion in the filter value as filter editor uses the current datetime if filterValue is not set. You can truncate time portion at run-time:
$(‘#demo’).wijgrid({
showFilter: true,
data: [
[0, new Date('01/01/2011')],
[1, new Date('06/30/2012')],
],
columns: [
{ },
{ dataType: 'datetime' }
],
filtering: function (e, args) {
if ((args.column.dataType === ‘datetime’) && (args.value instanceof Date)) {
args.value = new Date(args.value.toDateString());
}
}
});
| Answer | |||||||||||||||||||||||||
| Wijmo Team Member | Answer | ||||||||||||||||||||||||||
| Wijmo Team Member | AlexPaterson posted on June 26, 2012 at 8:52 am Hi everybody. I’m updating my experience with this wijmo grid issue after trying version 2.12. Besides that, the “equals” filter does not work on dates, even using IE. Just saying, so that you can check Simone | Answer | |||||||||||||||||||||||||
| Wijmo Team Member | sergeys posted on June 27, 2012 at 12:07 am I would need a small working sample for all three problems as I cannot reproduce any of them 1. datetime + “yyyy-mm-dd” BTW, you specified “mm” token in dataFormatString, this denotes munites, “MM” – months seems more logical to me. | Answer | |||||||||||||||||||||||||
| Wijmo Team Member | AlexPaterson posted on June 27, 2012 at 2:15 pm Sorry, I am using MM for month infact. Anyway, my DOM table is :
And my Wijmo grid is defined by this code: $(“#tabella”).wijgrid({ allowPaging: true, { dataType: "datetime", { dataType: "number", { dataType: "string", { dataType: "string", { footerText: " NEW ", ]}); I’m sorry I pasted lots of code, but I hope this will be of any help. Simone | Answer | |||||||||||||||||||||||||
| Wijmo Team Member | sergeys posted on June 29, 2012 at 12:36 am I can’t see any of the issues you mentioned in IE9\ FF 13 (check my sample attached to this post). There is a problem that if user does not edit a filter value for datetime column the filter is not applied, this will be fixed in the next version. In Safari browser there is a problem with dates in the “yyyy-MM-dd” format as Date.parse in Safari cannot parse ISO-8601 dates. I can see two options here: 1. Make the source table to initially conform the dataFormatString pattern.
var myDateParser = {
parse: function (value) {
var result = $.wijmo.wijgrid.embeddedParsers.dateTimeParser.parse.apply(this, arguments);
if (!result) {
// convert value to Date object manually
}
},
toStr: function (value) {
return $.wijmo.wijgrid.embeddedParsers.dateTimeParser.toStr.apply(this, arguments);
}
}
$(‘#demo’).wijgrid({
columns: [
{ dataType: "datetime", dataParser: myDateParser}
]
});
Attachments: | Answer | |||||||||||||||||||||||||
| Wijmo Team Member | AlexPaterson posted on June 29, 2012 at 7:42 am Thank you sergeys for your answer ! I do not know if this is an issue with my localization, I am using an Italian version of Firefox 13 and IE 9. script src=”http://cdn.wijmo.com/external/cultures/globalize.culture.it-IT.js” To the imports. But with no result. As per the issue about grid stuck in loading screen, your sample works and my table does not. I’ll check Thank you again ! | Answer | |||||||||||||||||||||||||
| Wijmo Team Member | AlexPaterson posted on June 29, 2012 at 8:18 am I found what the “loading” screen issue is : If the date field in my DOM table is indented this way : >TD> The grid does not work in Firefox and Safari. >TD> 2012-12-12 >/TD> It works and loads Wijmo grid correctly. | Answer | |||||||||||||||||||||||||
| Wijmo Team Member | sergeys posted on July 2, 2012 at 6:46 am The problem with TD formatting will be fixed in the next release of wijmo. As for DateTime + Equals:
filtering: function (e, args) {
if (args.column.dataType === ‘datetime’ && args.value instanceof Date) {
args.value = new Date(args.value.getFullYear(), args.value.getMonth(), args.value.getDate());
}
}
Please note that a ISO 8601 string parsed by js Date() object may have non-zero number of hours due to UTC offset which also may influence comparing dates with “Equals” operator. To diagnose you can try to verify data using grid’s data() method and compare them to the filter value in the filtering event handler. wijgrid compares dates as numbers returned by date.getTime(). | Answer |
You must be logged in to reply to this topic.