IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Ext JS / Sencha Discussion :

Probléme dans un ButtonText


Sujet :

Ext JS / Sencha

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Mai 2009
    Messages
    447
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Architecte de système d'information

    Informations forums :
    Inscription : Mai 2009
    Messages : 447
    Par défaut Probléme dans un ButtonText
    Bonjour à tous,
    jai un soucis dans un code .
    bon ce code permet de créer un boutton , en cliquant dessus il va afficher un message box contenant des bouttons renommer(on les a donné des nom avec le paramettre buttonText )
    voila le code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    Ext.widget('button', {
        renderTo: Ext.getBody()
        , text: 'Show Message'
        , handler: function () {
            Ext.Msg.show({
                title: 'Test',
                msg: 'Message body',
                buttonText: {ok: "1", yes: "2", no: "3", cancel: "4"},
                buttons: Ext.MessageBox.YESNOCANCEL
            });
        }
    });​
    voila ce qui va afficher :
    ce qui va afficher

    le probléme c'est que chez moi le code ne marche pas.il me donne les bouttons sans text comme si j'ai pas la ligne :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     buttonText: {ok: "1", yes: "2", no: "3", cancel: "4"},
    d'où vient le probléme.
    est ce que je doit importer quelque chose !
    Merci

  2. #2
    Expert confirmé
    Avatar de sekaijin
    Homme Profil pro
    Urbaniste
    Inscrit en
    Juillet 2004
    Messages
    4 205
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Urbaniste
    Secteur : Santé

    Informations forums :
    Inscription : Juillet 2004
    Messages : 4 205
    Par défaut
    j'ai cliqué sur ton lien ce qui va afficher et dans le code source j'ai collé ton code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     buttonText: {ok: "1", yes: "2", no: "3", cancel: "4"},
    ça donné ça
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    Ext.Msg.show({
                    title: 'Question',
                    width:300,
                    msg: 'Voulez vous quoi savoir',
                    buttonText: {ok: "1", yes: "2", no: "3", cancel: "4"},
                    buttons: Ext.Msg.YESNOCANCEL,
                    icon: 'adf-icon',
                    fn: function(btn) {
    j'ai cliqué sur update et ça donne le bon résultat voici le html généré
    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    <div id="messagebox-1001-toolbar-innerCt" class="x-box-inner " role="presentation" style="width: 324px; height: 22px; ">
      <div id="messagebox-1001-toolbar-targetEl" style="position:absolute;width:20000px;left:0px;top:0px;height:1px">
        <div id="button-1005" class="x-btn x-box-item x-toolbar-item x-btn-default-small x-noicon x-btn-noicon x-btn-default-small-noicon x-over x-btn-over x-btn-default-small-over over" style="border-width: 1px; left: 0px; margin: 0px; top: 0px; width: 75px; ">
          <em id="button-1005-btnWrap">
            <button id="button-1005-btnEl" type="button" class="x-btn-center" hidefocus="true" role="button" autocomplete="off" style="width: 69px; height: 16px; ">
              <span id="button-1005-btnInnerEl" class="x-btn-inner" style="width: 69px; ">
                1
              </span>
              <span id="button-1005-btnIconEl" class="x-btn-icon " style="">
              </span>
            </button>
          </em>
        </div>
        <div id="button-1006" class="x-btn x-box-item x-toolbar-item x-btn-default-small x-noicon x-btn-noicon x-btn-default-small-noicon" style="border-width: 1px; left: 81px; margin: 0px; top: 0px; width: 75px; ">
          <em id="button-1006-btnWrap">
            <button id="button-1006-btnEl" type="button" class="x-btn-center" hidefocus="true" role="button" autocomplete="off" style="width: 69px; height: 16px; ">
              <span id="button-1006-btnInnerEl" class="x-btn-inner" style="width: 69px; ">
                2
              </span>
              <span id="button-1006-btnIconEl" class="x-btn-icon " style="">
              </span>
            </button>
          </em>
        </div>
        <div id="button-1007" class="x-btn x-box-item x-toolbar-item x-btn-default-small x-noicon x-btn-noicon x-btn-default-small-noicon" style="border-width: 1px; left: 162px; margin: 0px; top: 0px; width: 75px; ">
          <em id="button-1007-btnWrap">
            <button id="button-1007-btnEl" type="button" class="x-btn-center" hidefocus="true" role="button" autocomplete="off" style="width: 69px; height: 16px; ">
              <span id="button-1007-btnInnerEl" class="x-btn-inner" style="width: 69px; ">
                3
              </span>
              <span id="button-1007-btnIconEl" class="x-btn-icon " style="">
              </span>
            </button>
          </em>
        </div>
        <div id="button-1008" class="x-btn x-box-item x-toolbar-item x-btn-default-small x-noicon x-btn-noicon x-btn-default-small-noicon" style="border-width: 1px; left: 243px; margin: 0px; top: 0px; width: 75px; ">
          <em id="button-1008-btnWrap">
            <button id="button-1008-btnEl" type="button" class="x-btn-center" hidefocus="true" role="button" autocomplete="off" style="width: 69px; height: 16px; ">
              <span id="button-1008-btnInnerEl" class="x-btn-inner" style="width: 69px; ">
                4
              </span>
              <span id="button-1008-btnIconEl" class="x-btn-icon " style="">
              </span>
            </button>
          </em>
        </div>
      </div>
    </div>

    A+JYT

  3. #3
    Membre éclairé
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Mai 2009
    Messages
    447
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Architecte de système d'information

    Informations forums :
    Inscription : Mai 2009
    Messages : 447
    Par défaut
    pardon voila le nouveau lien .
    mon probléme c'est que le paramétre ButtonText ne marche pas sur mon code local.
    je voudrais au lieu d'afficher OK, yes,no, afficher 'text1' ......
    Merci

  4. #4
    Expert confirmé
    Avatar de sekaijin
    Homme Profil pro
    Urbaniste
    Inscrit en
    Juillet 2004
    Messages
    4 205
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Urbaniste
    Secteur : Santé

    Informations forums :
    Inscription : Juillet 2004
    Messages : 4 205
    Par défaut
    là encore j'ai juste cliqué sur ton lien et sur le bouton et tous fonctionne normalement
    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    <div id="messagebox-1001-toolbar" class="x-toolbar x-docked x-toolbar-footer x-docked-bottom x-toolbar-docked-bottom x-toolbar-footer-docked-bottom x-box-layout-ct" style="width: 590px; left: 4px; top: 75px; ">
       <div id="messagebox-1001-toolbar-innerCt" class="x-box-inner " role="presentation" style="width: 584px; height: 22px; ">
          <div id="messagebox-1001-toolbar-targetEl" style="position:absolute;width:20000px;left:0px;top:0px;height:1px">
             <div id="button-1005" class="x-btn x-box-item x-toolbar-item x-btn-default-small x-noicon x-btn-noicon x-btn-default-small-noicon" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; width: 75px; left: 130px; top: 0px; ">
                <em id="button-1005-btnWrap">
                   <button id="button-1005-btnEl" type="button" class="x-btn-center" hidefocus="true" role="button" autocomplete="off" style="width: 69px; height: 16px; ">
                      <span id="button-1005-btnInnerEl" class="x-btn-inner" style="width: 69px; ">
                         text1
                      </span>
                      <span id="button-1005-btnIconEl" class="x-btn-icon "></span>
                   </button>
                </em>
             </div>
             <div id="button-1006" class="x-btn x-box-item x-toolbar-item x-btn-default-small x-noicon x-btn-noicon x-btn-default-small-noicon" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; width: 75px; left: 211px; top: 0px; ">
                <em id="button-1006-btnWrap">
                   <button id="button-1006-btnEl" type="button" class="x-btn-center" hidefocus="true" role="button" autocomplete="off" style="width: 69px; height: 16px; ">
                      <span id="button-1006-btnInnerEl" class="x-btn-inner" style="width: 69px; ">
                         text1
                      </span>
                      <span id="button-1006-btnIconEl" class="x-btn-icon "></span>
                   </button>
                </em>
             </div>
             <div id="button-1007" class="x-btn x-box-item x-toolbar-item x-btn-default-small x-noicon x-btn-noicon x-btn-default-small-noicon" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; width: 75px; left: 292px; top: 0px; ">
                <em id="button-1007-btnWrap">
                   <button id="button-1007-btnEl" type="button" class="x-btn-center" hidefocus="true" role="button" autocomplete="off" style="width: 69px; height: 16px; ">
                      <span id="button-1007-btnInnerEl" class="x-btn-inner" style="width: 69px; ">
                         text1
                      </span>
                      <span id="button-1007-btnIconEl" class="x-btn-icon "></span>
                   </button>
                </em>
             </div>
             <div id="button-1008" class="x-btn x-box-item x-toolbar-item x-btn-default-small x-noicon x-btn-noicon x-btn-default-small-noicon" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; width: 75px; left: 373px; top: 0px; ">
                <em id="button-1008-btnWrap">
                   <button id="button-1008-btnEl" type="button" class="x-btn-center" hidefocus="true" role="button" autocomplete="off" style="width: 69px; height: 16px; ">
                      <span id="button-1008-btnInnerEl" class="x-btn-inner" style="width: 69px; ">
                         text1
                      </span>
                      <span id="button-1008-btnIconEl" class="x-btn-icon "></span>
                   </button>
                </em>
             </div>
          </div>
       </div>
    </div>
    A+JYT

  5. #5
    Membre éclairé
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Mai 2009
    Messages
    447
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Architecte de système d'information

    Informations forums :
    Inscription : Mai 2009
    Messages : 447
    Par défaut
    ouii sekaijin, dans le lien tous ça marche impécable.
    je comprends pas pourquoi tu écris un code html. moi je poste un code js !!
    ok, mais le probléme lorsque j'exécute le code chez moi , le paramètre ButtonText ne fonctionne pas ;
    ce code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    Ext.widget('button', {
        renderTo: Ext.getBody()
        , text: 'Show Message'
        , handler: function () {
            Ext.Msg.show({
                title: 'Test',
                msg: 'Message body',
                buttonText: {ok: "text1", yes: "text1", no: "text1", cancel: "text1"},
                buttons: Ext.MessageBox.YESNOCANCEL
            });
        }
    });​
    doit afficher le message box comme suit:
    Nom : txt1.png
Affichages : 46
Taille : 3,7 Ko
    mais lorsque j'éxécute le code il me donne un messagebox comme:
    Nom : txt2.png
Affichages : 50
Taille : 2,9 Ko
    donc le paramètre buttonText n'est pris en compte.je porte à votre connaissance que le code est le même qui est dans le lien.
    d'où vient le problème !!

  6. #6
    Expert confirmé
    Avatar de sekaijin
    Homme Profil pro
    Urbaniste
    Inscrit en
    Juillet 2004
    Messages
    4 205
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Urbaniste
    Secteur : Santé

    Informations forums :
    Inscription : Juillet 2004
    Messages : 4 205
    Par défaut
    Je poste le code HTML que ton javascript génére

    il mets bien le texte que tu as mis dans le JS
    Donc ça marche

    A+JYT

Discussions similaires

  1. Problème dans la déclaration de Winmain
    Par lvdnono dans le forum DirectX
    Réponses: 3
    Dernier message: 29/05/2004, 13h38
  2. problème dans l'hebergement
    Par Redouane dans le forum ASP
    Réponses: 9
    Dernier message: 31/12/2003, 23h34
  3. Quel est le problème dans ce code ?
    Par Luther13 dans le forum C
    Réponses: 12
    Dernier message: 26/08/2003, 16h09
  4. Problème dans analisys Manager
    Par ien_ien23 dans le forum MS SQL Server
    Réponses: 7
    Dernier message: 11/07/2003, 14h38
  5. Problème dans requête avec count()
    Par BadFox dans le forum Requêtes
    Réponses: 3
    Dernier message: 08/07/2003, 18h02

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo