RSS

LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Problems / On click on Check Mark send value to DataBase
Posted:  07 Jan 2016 04:46
Hello everybody ,
I tried when I check a check box, sent a request to Database

1)
On 'Check Mark' 
UPDATE table Student
SET    column1 = expression1
WHERE  id= 50

2)
if column1 = expression1 in the BD
The 'Check Mark will be selected'

3)
Without appearing the second confirmation page
http://img15.hostingpics.net/pics/735332CheckMark.png
Here are more details in the picture
If you have an idea
Thanks
Posted:  07 Jan 2016 20:51   Last Edited By: Roel B.
Bonsoir Eamon,

This is typically something that would be best implemented with Ajax.
When the checkbox is clicked, start a JavaScript function, . . .
1. the JS function sends an XMLHttpRequest (with the event ID) to a "check" server script (using the "open" and "send" method; very important: use POST and not GET!)
2. the "check" server script checks the database and toggles the value in the database's events table
3. the "check" server script sends back the check mark symbol (if checked) or a blank (if unchecked)
4. the JS function uses the xhttp.responseText with the check mark symbol and replaces the .innerHTML of the checkbox by the received check mark symbol

Pretty neat, isn't it. It's simple and fast (no reload of the calendar page).
I like it, and I will implement this myself in the next LuxCal version smile

You can find a description and some working examples here.
Roel
Posted:  14 Jan 2016 11:50
Roel,

Can you give an example or two of where and how this would be used in the next version?

Thanks,
Dan
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html
Posted:  14 Jan 2016 18:36   Last Edited By: Roel B.
Hi Dan,

When you add/edit an event category and you select "check mark", all events in that category will get a check mark in front of their title in all views and the events will show up in the ToDo list as long as the check mark is has not been checked. The purpose of the check mark is to create events which need an action and once the action is complete, the check mark can be checked by the user so that he/she remembers that the action was done.

Up to V4.3.0, this "checking/unchecking" of the check mark is accomplished by clicking on the check mark, which will open a Check Event window where the check mark can be checked/unchecked and the window closed. The calendar page will be reloaded and the checking/unchecking of the check mark will be shown
As of V4.3.1, the check mark has become interactive and the"checking/unchecking" can be done directly by clicking the check mark in front of the event title. This means that the Check Event window has become redundant.

It's not a enormous improvement, but it's just a small simplification.
(Fwiw: From developer's viewpoint I like it, because it's now done using AJAX (Asynchronous JavaScript and XML), which means that the change is made without reloading the full webpage).
Roel
Posted:  15 Jan 2016 09:57   Last Edited By: Danwestlake
Hi Roel,

Thank you for the detailed explanation.

So it is similar to a feature for a shared desktop version of a calendar my wife and I use. The difference with it is when we mark it done / completed it puts a line through text similar to the strike-through text in html. http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_strike which makes it stand out as done like the check mark.

Dan
__________________
"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html