Hi everyone,
I am facing a very interesting problem. I want to create a simple Todo app with DataSource and templating engine. ( I dont want to using Grid yet. )
The ID of my model is TODOID (I am using oracle db with open access.) I want to use this id field in the template. It works properly until I want to add a new Todo Item. For example:
$("#add-button").click(function () {
dataSource.add({
"TITLE": "asd",
"PRIORITY": 3,
"DEADLINE": "2013-02-02",
"DONE": false
});
dataSource.sync();
});
In that case, I get an error: "ReferenceError: TODOID is not defined". But if I include the TODOID field as well (e.g "TODOID": 100) then my create method is not being called. It is called only when I dont include the id field in new todo item AND I am not using that field in the template. But I have to use the TODOID field in the template to able to modify or delete and select an item.
So, how can i add a new todo item to the datasource without the reference error but also being able to select a single item in the UI?
Or I am doing it the wrong way and I have to use Grid?
Thank you for your answers,
Daniel