cannot open app(enyo)

Hey.. I am making an app. in enyo. it's just the java script code that am using .
If i put this code in my index.html inside tag , then the app is working .But if i put the code in my main.js(the file that i have rendered initially ) then it's not working though it's not giving me ny error as well. I have included the file in depends.js.
What I have done is put that js code inside myinit() and this function i have called it from create() of my main.js.
the code is a little long. any help?

Comments

  • Enyo relies on you having some JS code in the index.html, as it needs a HTML DOM to be setup in order to have a place to render your application. What's the objection to having a render call in the index.html file?
  • actually in b/w js code i have to call another scene that i have made in enyo framework...so i think that the js code has to be put in main.js only then i could call the other scene.?
  • and this HTML DOM to be setup..i did'nt actually get what is it!
  • I think including some code would be helpful
  • edited February 2012
    here's part of my code..
    
       SocialCalc.Constants.s_loc_plain = "Plain";
       SocialCalc.Constants.s_loc_graph = "Graph";
       SocialCalc.Constants.s_loc_cells_to_graph = "Cells to Graph";
       SocialCalc.Constants.s_loc_set_cells_to_graph = "Set Cells To Graph";
       SocialCalc.Constants.s_loc_graph_type = "Graph Type";
       SocialCalc.Constants.s_loc_help = "Help";
       SocialCalc.Constants.s_loc_horizontal_bar = "Horizontal Bar";
       SocialCalc.Constants.s_loc_not_set = "Not Set";
       SocialCalc.Constants.s_loc_unknown_range_name = "Unknown range name";
       SocialCalc.Constants.s_loc_hide_help = "Hide Help";
    
    
    
       // Add Help
    
       spreadsheet.tabnums.help = spreadsheet.tabs.length;
       spreadsheet.tabs.push({name: "help", text: "Help", html:
          ''+
          '  '+
          '',
          view: "help",
          onclick: DoHelp,
          onclickFocus: true
          });
    
       spreadsheet.views["help"] = {name: "help",
          divStyle: "border:1px solid black;overflow:auto;",
          html: 'Help View'
          };
    
       // Initialize the Spreadsheet Control and display it
    
       spreadsheet.InitializeSpreadsheetControl("tableeditor");
       spreadsheet.ExecuteCommand('redisplay', '');
    
    function doreload() {...
    ....
    // and SOME MORE FUNCTIONs like this...
    
    
    it's working when i put this code in script tag in index.html!
  • I don't see anything in your example that uses any part of enyo so I'm not sure where your issue is. A normal enyo project would have:

    index.html - contains a tag to include the enyo framework and a tag in the body to render your top-level Kind. Something like:
    
      new my.app.Main().renderInto(document.body);
    
    depends.js (enyo v1) / package.js (enyo v2) - a list of resources to be included.
    
    enyo.depends(
      "file1.js",
      "style.css",
      "anotherfile.js")
    
    Each of those files has whatever code/css needed which would likely be what you shared above.
  • Yes u mean that i should put my whole js code inside the create function of my file that is being rendered..is there any other method through which i could do this (like launching my event as soon as my app gets loaded.) ??
  • You haven't shown us any code that has anything to do with enyo...
  • actually that is the secondary thing ...first i just want to accomodate the type of code like shown above(coz it would give me the UI) . how can i iinclude this type of code (any method other than using create) ?
Sign In or Register to comment.