this file contains all the javascript needed by the todo_list. it requires prototype.js. The calling page must have the gDossier More...
Go to the source code of this file.
Functions | |
| function | add_todo () |
| function | todo_list_remove (p_ctl) |
| function | todo_list_show (p_id) |
| function | todo_list_show_error (request_json) |
| function | todo_list_show_success (req) |
this file contains all the javascript needed by the todo_list. it requires prototype.js. The calling page must have the gDossier
Definition in file todo_list.js.
| function add_todo | ( | ) |
Definition at line 88 of file todo_list.js.
| function todo_list_remove | ( | p_ctl | ) |
Definition at line 100 of file todo_list.js.
| function todo_list_show | ( | p_id | ) |
Definition at line 28 of file todo_list.js.
References alert(), offsetX, offsetY, posX, posY, style, todo_list_show_error(), todo_list_show_success(), and value.
{
var gDossier=$('gDossier').value;
$('add_todo_list').style.top=(posY+offsetY)+'px';
$('add_todo_list').style.left=(posX+offsetX-200)+'px';
try
{
var action=new Ajax.Request(
'ajax_todo_list.php',
{
method:'get',
parameters:
{'show':
1,'id':
p_id,'gDossier':
gDossier
},
onFailure:todo_list_show_error,
onSuccess:todo_list_show_success
}
);
}
catch (e)
{
alert(" Envoi ajax non possible" + e.message);
}
return false;
}
| function todo_list_show_error | ( | request_json | ) |
Definition at line 84 of file todo_list.js.
References alert().
Referenced by todo_list_show().
{
alert ('failure');
}
| function todo_list_show_success | ( | req | ) |
Definition at line 57 of file todo_list.js.
References alert(), getNodeText(), style, and value.
Referenced by todo_list_show().
{
try
{
var answer=req.responseXML;
var tl_id=answer.getElementsByTagName('tl_id');
var tl_title=answer.getElementsByTagName('tl_title');
var tl_desc=answer.getElementsByTagName('tl_desc');
var tl_date=answer.getElementsByTagName('tl_date');
if ( tl_id.length == 0 )
{
var rec=req.responseText;
alert ('erreur :'+rec);
}
$('p_title').value=getNodeText(tl_title[0]);
$('p_date_todo').value=getNodeText(tl_date[0]);
$('p_desc').value=getNodeText(tl_desc[0]);
$('tl_id').value=getNodeText(tl_id[0]);
$('add_todo_list').style.display='block';
}
catch (e)
{
alert(e.message);
}
}