We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2611
    • 394 Posts
    If i create a new instance of something...perhaps an array:

    var myArray = new Array();


    And i want to store that in a div with id "my-div".
    How would i go about this? I’ve tried:

    var myDiv = Ext.get('my-div');
    myDiv.myArray = myArray;


    But later on when i get the div somewhere in my code ’myArray’
    is not set.

    Please help.
      Follow me on twitter: @b03tz
      Follow SCHERP Ontwikkeling on twitter: @scherpontwikkel
      CodeMaster
      • 2611
      • 394 Posts
      Sure, always...when you post a question you answer it 5 minutes later.

      For others having the same issue, be sure to call Ext.get in both the writing
      and getting process.

      myDiv = Ext.get(myDiv);
      myDiv.customAttribute = 'test';
      
      // Then when you get it:
      myDiv = Ext.get(myDiv);
      alert(myDiv.customAttribute);


      Works like a charm..
        Follow me on twitter: @b03tz
        Follow SCHERP Ontwikkeling on twitter: @scherpontwikkel
        CodeMaster