Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!