In Sencha CMD, how to specify widget files absolute paths in the generated bootstrap.js? - sencha-touch

I am new to Sencha Touch and the Sencha world. During sencha app build in development, I want to specity my server absolute url in the generated bootstrap.js so that the Sencha loader loads the widgets using the correct url.
How can I do this?
Any pointer would be appreciated.

You want to utilize paths configuration. This can and should be done in your application definition (app.js) by adding an array of paths. Here you can map a specific/custom class namespace to a URL path.
You will also want to add this to "classpath" in app.json.

Related

How can I programmatically generate a file at build-time in Create React App?

I'd like for my Create React App to generate a file called VERSION.txt that will end up in my deployed site's public directory as part of its build.
I know I can just create a static file in my repo's public/VERSION.txt, but I want its contents to come from an environment variable. The ENV variable is REACT_APP_COMMIT_REF, which is coming from my Netlify setup. I'd like my CRA to put this variable in public/VERSION.txt (so my React app can easily check it to see if a new version exists), but the docs on environment variables says they're only available in index.html (as well as in any source JS code via process.env).
As a workaround for now I've put it in a meta tag in my public/index.html
<meta name="app-version" content="%REACT_APP_COMMIT_REF%" />
but my app code now has to parse this string and I'd rather just have a public/VERSION.txt to achieve this.
Is it possible for CRA to programmatically generate files at build-time?

How to change the default index.html file in titanium mobile web?

I would like to know how to change the default index.html file. I have created a classic project (for mobile web). In that I have created a .css file which includes my custom styles. Now I would like to include this file in index.html, so that those styles will apply on my application. But haven't seen the index.html file. After build, I am able to see this file in build folder. May I know how to update the index.html file?
Thanks in Advance,
Swathi.
Appcelerator uses XML for views, TSS for styling, and JS for controllers. Then Titanium compiles your source code into the native API (HTML for mobile web). Because you can also compile for iOS, Android, and Windows, your output is converted appropriately to your build directory. When you create a new Alloy project, you will find the default index.xml, index.tss, and index.js in the app views, styles, and controllers directories respectively. So to control index.html, edit these 3 index.* files.

How do I point out the path to Sencha touch lib

I had to move the lib folder of senchas touch framework. Now I keep getting errors where Sencha look for the framwork in the wrong folder. In which config file do I define the path of the framework? Is it in the hidden .Sencha-folder?
New location is lib/touch/
You will find and entry inside the {root}/bootstrap.js
"Ext": "touch/src",
Around line 4. Change this to your needs

How to use Free CSS Templates with ASP.NET MVC 4?

I need to use a css template for webpage I am building but I don't know how to use in asp.net mvc4. so How to use CSS Templates with ASP.NET MVC 4 in visual studio 2012 for web application?
It's simple:
Move your css and images into ~/Contents folder.
Move your js files into ~/Scripts folder
Copy and paste your html snippets to cshtml files
On 3rd step you need to port the layout portion of your template to ~/Veiws/Shared/_Layout.cshtml. Here you need to point references to your css and js correctly. For example:
And also you need to be aware that _Layout.cshtml should contain #RenderBody(). That's where all child views will be inserted.
Just found a video with basic demonstration of process: link
It is the same as you use for simpe HTML files. In the solution you can add an existing item and your browse your CSS file which will be added in the Content folder then you have to reference it in the page where it will be used.
If you want to apply all the rules to every page you can reference it in the _Layout.cshtml page which is called before everypage. It is like the container.
You have many options to call it. I will suggest you also reading Bundling and minification in this link which is also interesting to know.
There are Few Steps:
Make Directory inside Content folder in my case mytemplate.
Copy all your template content inside mytemplate folder.
Add new Layout page in View>Shared Folder in my case _mytemplate.cshtml.
open your template Index.html file inside any editor(i.e: Dreamviewer,Notepad etc).
Copy all header stuff from your html file to inside of Header in _mytemplate.cshtml file.
Copy all body stuff Inside of your Index.cshtml to Layout page.
Save your Project by Cntrl+S and Run it in browser. Thats it.

Difference between Sencha-touch-all and Sencha-touch.js library files?

Still not clear with this. I am testing with simple login form (Version is 2.2.1 and no external CSS or JS). After looking up the resource consuming, I am confused with js should i prefer either (sencha-touch.js or sencha-touch-all.js) for development and production. By default the microloader maps to sencha-touch.js. Should i change it?
sencha-touch.js -->
sencha-touch-all.js -->
Here it just give only 29 hits to server but downloading 4 mb of file which is larger than sencha-touch
sencha-touch.js will be making a request to individual source files for each component your app requires in. sencha-toucha-all.js includes all components by default.
See this guide in the docs for more info:
http://docs.sencha.com/touch/2.3.0/#!/guide/building
More specifically, this is what you should be doing:
- use sencha-touch.js in development
- have each of your files require in all the sencha touch components/proxies etc it needs
- when you want to go to production, use the sencha app build command in your terminal to build to a single, minified javascript file which then contains all your code and all the sencha touch code your app needs.