[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Dolibarr-dev] commande : dernière lignedoublée
From: |
Christophe PEREZ |
Subject: |
RE: [Dolibarr-dev] commande : dernière lignedoublée |
Date: |
Tue, 13 Jun 2006 14:42:40 -0400 |
Le mardi 13 juin 2006 à 20:27 +0200, Régis Houssin a écrit :
> Firefox aussi, et c'est carrément plus lent pour qu'il crée la liste
> déroulante, chez moi en tout cas.
Tu es sûr d'avoir bien nettoyé la fonction select_produit() ?
========================= >8 ============================
--- htdocs/html.form.class.php 10 Jun 2006 18:43:11 -0000 1.249
+++ htdocs/html.form.class.php 13 Jun 2006 18:35:55 -0000
@@ -703,17 +703,12 @@
global $langs,$conf,$user;
if($conf->use_ajax)
{
- print '<script type="text/javascript"
src="'.DOL_URL_ROOT.'/lib/prototype.js"></script>';
print $langs->trans("Ref").'<input type="text"
size="5" name="ajkeyref'.$htmlname.'"
id="ajkeyref'.$htmlname.'"> ';
print $langs->trans("Label").'<input type="text"
size="5" name="ajkeylabel'.$htmlname.'" id="ajkeylabel'.$htmlname.'">';
print '<input type="hidden" name="'.$htmlname.'"
id="'.$htmlname.'" value="">';
print '<script type="text/javascript">';
print 'var url =
\''.DOL_URL_ROOT.'/ajaxresponse.php\';';
print 'new
Form.Element.Observer($("ajkeyref'.$htmlname.'"), 1, function(){var
myAjax = new Ajax.Updater( {success: \'ajdynfield'.$htmlname.'\'}, url,
{method: \'get\', parameters: "keyref="+$("ajkeyref'.$htmlname.'").value
+"&htmlname='.$htmlname.'&price_level='.$price_level.'"});});';
- print 'function
publish_selvalue(obj){$("'.$htmlname.'").value =
obj.options[obj.selectedIndex].value;}';
- print '</script>';
- print '<script type="text/javascript">';
- print 'var url =
\''.DOL_URL_ROOT.'/ajaxresponse.php\';';
print 'new
Form.Element.Observer($("ajkeylabel'.$htmlname.'"), 1, function(){var
myAjax = new Ajax.Updater( {success: \'ajdynfield'.$htmlname.'\'}, url,
{method: \'get\', parameters:
"keylabel="+$("ajkeylabel'.$htmlname.'").value
+"&htmlname='.$htmlname.'&price_level='.$price_level.'"});});';
print '</script>';
print '<div id="ajdynfield'.$htmlname.'">';
========================= >8 ============================
Mais attention, du coup, l'ajax sur ces listes ne fonctionnera plus sur
tous les scripts qui font appel à cette fonction. Il faut tous les
modifier.
Comme par exemple :
========================= >8 ============================
--- htdocs/commande/fiche.php 10 Jun 2006 10:50:26 -0000 1.198
+++ htdocs/commande/fiche.php 13 Jun 2006 18:38:58 -0000
@@ -691,6 +691,12 @@
print
'<td>'.$langs->trans('Qty').'</td>';
print
'<td>'.$langs->trans('ReductionShort').'</td>';
print '</tr>';
+if($conf->use_ajax) {
+ print '<script type="text/javascript"
src="'.DOL_URL_ROOT.'/lib/prototype.js"></script>';
+ print '<script type="text/javascript">';
+ print 'function publish_selvalue(obj){$(obj.name).value =
obj.options[obj.selectedIndex].value;}';
+ print '</script>';
+}
for ($i = 1 ; $i <= $NBLINES ; $i++)
{
print '<tr><td>';
========================= >8 ============================
Mais là, c'était juste pour test, car ce n'est sans aucun doute pas la
bonne méthode pour faire quelque chose de générique. C'était juste pour
traquer le bug, qui sans nul doute est lié à cette multiplication de
code.
Je laisse le soin au concepteur de cette fonctionnalité ajax de faire
plus propre et de l'implémenter partout où il se doit ;-)
--
Christophe
- [Dolibarr-dev] commande : dernière ligne doublée, Christophe PEREZ, 2006/06/12
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Régis Houssin, 2006/06/12
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Christophe PEREZ, 2006/06/12
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Régis Houssin, 2006/06/12
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Christophe PEREZ, 2006/06/13
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Régis Houssin, 2006/06/13
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Christophe PEREZ, 2006/06/13
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Régis Houssin, 2006/06/13
- RE: [Dolibarr-dev] commande : dernière lignedoublée,
Christophe PEREZ <=
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Christophe PEREZ, 2006/06/13
- Re: [Dolibarr-dev] commande : dernière ligne doublée, Laurent Destailleur (Eldy), 2006/06/13
- Re: [Dolibarr-dev] commande : dernière lignedoublée, Christophe PEREZ, 2006/06/13
- Re: [Dolibarr-dev] commande : dernière lignedoublée, Christophe PEREZ, 2006/06/13
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Régis Houssin, 2006/06/14
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Christophe PEREZ, 2006/06/14
- RE: [Dolibarr-dev] commande : dernière lignedoublée, Christophe PEREZ, 2006/06/13