Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
extjs keyMap addBinding method bug?

Hi I have 2 variants of code both do not work. My problem is I want to pass an argument into handler of addBinding method. console.log(x) returns as it should be but when it is passed into handler problem is that that the argument for that function is same for all of the bindings and I want to have it different base on tagValue (tagValue = argument I want in the function). What is wrong? Posting a 2 variants of code (good to mention that for example key is linked without any problem only handler have problems):

     for (j = 0, len = ref1.length; j < len; j++) {
      tag = ref1[j];
      if (tag.key !== void 0) {
        tagValue = name + "/" + tag.label;
        tagKey = tag.key;
        tagg = tag.label;
        x = "this.onTagHotkey('" + ("" + tagValue) + "');";
        console.log(x);
        map.addBinding({
          key: "" + tagKey,
          scope: this,
          handler: function() {
            return eval(x);                                           #problem here
          }
        });
        console.log(map);
      }

or

     for (j = 0, len = ref1.length; j < len; j++) {
      tag = ref1[j];
      if (tag.key !== void 0) {
        tagValue = name + "/" + tag.label;
        tagKey = tag.key;
        tagg = tag.label;
        map.addBinding({
          key: "" + tagKey,
          scope: this,
          handler: function() {
            return this.onTagHotkey(tagValue);                       #problem here
          }
        });
        console.log(map);
      }
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda