-
20 Feb 2009 3:30 AM #1
Some common questions
Some common questions
Hi folks,
I have a couple of questions. It would be nice, to get an answere..
as you can see, I've created a function to create a Window.
1) In this case, this should be a login window. But how the hell can I tell this button not to be in the middle, but at the right side of the window. something like a position tag or so.
2) Also, I saw some issues about Panels.. Why do I need Panels? I mean where exactly is the benefit if i am using it, instead of just putting all my elements directly to the window?
3) What kind of programming style is a good one? Recently I worked at a very big Java Project and I really liked the structure there. So I am new at EXTjs, and I am searching for a simliar kind of structure.
Is it a good style, to create a new js File for every component I am writing? if so, is there another posibillity, to use all the components in my index.html? Currentyl I am include all the scripts like this: <script lanuage="text/javascript" src="..."></script>
Thank u guys for your help
Chriz
PHP Code:function createWindow(p_width, p_height, p_title){
var win = new Ext.Window({
width: p_width,
height: p_height,
resizable: true,
maximizable: true,
title: p_title,
items:[{
xtype:'form'
,id:'testform'
,defaultType:'textfield'
,frame:true
,defaults:{anchor:'95%'}
,items:[
{
fieldLabel:'Username:'
,id:'username'
},
{
fieldLabel:'Password:'
,id:'password'
}
]
,buttons:[{
formbind:true,
text: "moin",
handler:function(){
Ext.Msg.alert("test");
}
}]
}]
})
win.show();
}
-
20 Feb 2009 3:34 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
1. buttonAlign:'right'.
2. Panels are widely overused. In most cases (like yours) you don't need an extra Panel.
You need an extra container (can be a simple Container, not even a Panel) if you want some items inside a layout to be layed out differently (e.g. form layout inside a column layout).
3. Yes, creating a file for every component is good practice.
During testing you should indeed include all files separately, but for the final distribution you should merge, compress (use YUICompressor) and gzip the result.
-
20 Feb 2009 3:51 AM #3
thank you for your reply. you really helped me out dude.
ok, here's another one (i am still learning...)
1) What I want to do is that the user calls the Web-App like http://www.foo.de/webapp
Now the first thing this user should see is this login dialog. If the user's logn was succesfully, he/she should be forwarded to the main page.
Will it be the best thing, to work with cookies / sessions? I think about creating 2 jsp pages. in the index page, there's only the dialog displayed. If all is ok, the user is forwarded to the main page, or something like that.
2) if I understand the concept correct, I have to use only 1, maximum 2 html/jsp page(s) and all the action is done by some JavaScripts. (This is completly new for me, as I told u I am comming from the java side with as much classes as possible
)
Thanks
Chriz
-
20 Feb 2009 4:56 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
1. Yes, you could create 2 pages and forward (remember to use standardSubmit:true, because an XHR request won't follow the forward). Or you could just create 1 page and make the login window modal:true.
2. Yes, your entire application can consist of:
- one HTML page
- one or more javascript files
- one or more css files (+images).
-
20 Feb 2009 5:16 AM #5
-
20 Feb 2009 5:58 AM #6
Suggest you scan the main wiki tutorials page. There's some articles on design/layout of code, suggestions on writing large applications, minification, etc.
There are a few examples of logins about (sample apps, etc.). I think you have the drift of the login already though.MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow


Reply With Quote