Hi, I am having problem with editing date in grid. Date is stored in DB as SQLite type, it is shown in select result as yyyy-MM-dd. I have already some data in DB from my other project and I used this function in SQL to store date
Kendo UI Grid shows date as yyyy-MM-dd so I change the format to:
When I try to edit row, the DatePicker value is empty. Doesn't show the value from TestDate column and the DatePicker is set to "now" date. When I change the date and click on Update nothing happend. I can see new value in grid, but the edit window is still open and I get bact the old value after refresh .
Update function:
So my question is:
1. How to set DatePicker value to date which I am editing when the edit window popup?
2. Which date format I should use to select, update and insert data to WebSQL and where and how I should do that.
Thank you for your answer :)
"...Date = STRFTIME('%Y-%m-%d', '?')..."
{ field:
"TestDate"
, title:
"Datum"
, template:
"#= kendo.toString(kendo.parseDate(TestDate, 'yyyy-MM-dd'), 'dd.MM.yyyy') #"
}
Update function:
function
update(db, model, callback)
{
db.transaction(
function
(tx)
{
tx.executeSql(
"update Costs set Amount = ?, Date = STRFTIME('%Y-%m-%d', '?'), CostTypeId = ?, CurrencyId = ?, CountryId = ?, Description = ?, CZK = NULL where Id = ?"
,
[model.Amount, model.TestDate, model.CostTypeId, model.CurrencyId, model.CountryId, model.Description, model.ID],
function
(tx, result)
{
callback([]);
});
});
}
So my question is:
1. How to set DatePicker value to date which I am editing when the edit window popup?
2. Which date format I should use to select, update and insert data to WebSQL and where and how I should do that.
Thank you for your answer :)