PDA

View Full Version : [TUTORIAL UPDATE] Extending Ext Class



jsakalos
2 Jan 2008, 5:22 PM
Hi all!

I've just finished updating the tutorial to Ext 2.0 version so all interested can take a look at it:

http://extjs.com/learn/Tutorial:Extending_Ext2_Class

Enjoy,

DigitalSkyline
2 Jan 2008, 8:38 PM
Saki,
=; You once argued the merits of preceding commas (to each their own) but being that it goes against the Ext standard we are left to suffer with snippets like this:



var win = new Ext.Window({
title:'Icon Combo Ext 2.0 Extension Class Example'
,width:400
,height:300
,layout:'form'
,bodyStyle:'padding:10px'
,labelWidth:70
,defaults:{anchor:'100%'}
,items:[{
xtype:'iconcombo'
,fieldLabel:'IconCombo'
,store: new Ext.data.SimpleStore({
fields: ['countryCode', 'countryName', 'countryFlag'],
data: [
['US', 'United States', 'ux-flag-us'],
['DE', 'Germany', 'ux-flag-de'],
['FR', 'France', 'ux-flag-fr']
]
}),
valueField: 'countryCode',
displayField: 'countryName',
iconClsField: 'countryFlag',
triggerAction: 'all',
mode: 'local', // extra comma
}]
});
8-|

Just a little confusing isn't it? I see it happening all the time now... not a good trend really.

Anyways, just thought I'd a little about it to you, since its a trend you seemed to have started!:((

Can we please pick a consistent coding style and stick to it? No hard feelings intended! :">

tof
3 Jan 2008, 1:43 AM
I do agree, although I respect Saki for his lot of good work on extjs, and all his comments/help/... I can't stand the "preceding commas" neither :">

I prefer using jslint to eliminate comma's bugs (and other).

But, yeah, that's just an opinion.

Ytorres
3 Jan 2008, 1:58 AM
Hi Saki,

I made changes affecting the commas on your tutorial.

Thank you for this beautiful article ;)

jsakalos
3 Jan 2008, 2:14 AM
As I don't want you to "suffer" and I want you to "stand" reading my code I've changed leading commas to trailing ones in the above tutorial.

However, it doesn't change my own coding practice (you can find reasons for leading commas here: http://extjs.com/forum/showthread.php?t=6796) so when I will need to post fragments of my own code while handling help queries I'll post them unmodified.

DigitalSkyline
3 Jan 2008, 2:16 AM
I do agree, although I respect Saki for his lot of good work on extjs, and all his comments/help/... I can't stand the "preceding commas" neither :">

...

But, yeah, that's just an opinion.

absolutely... and you know that saying about opinions... >:)

jsakalos
3 Jan 2008, 2:19 AM
Hi Saki,

I made changes affecting the commas on your tutorial.

Thank you for this beautiful article ;)

Thank you, we were doing it at the same time... ;)

jsakalos
3 Jan 2008, 2:21 AM
I cannot stand to post one more comment on commas: I'm trying to show you how to fly to the the space and you're complaining about the color of the space ship... OK, now it's repainted...

DigitalSkyline
3 Jan 2008, 2:26 AM
As I don't want you to "suffer" and I want you to "stand" reading my code I've changed leading commas to trailing ones in the above tutorial.

However, it doesn't change my own coding practice (you can find reasons for leading commas here: http://extjs.com/forum/showthread.php?t=6796) so when I will need to post fragments of my own code while handling help queries I'll post them unmodified.

Saki , You should know anything you provide to the community is appreciated ... just complaining for the sake of (well who knows)... but my point of mixing styles being confusing remains. Anyways... ~o)

jay@moduscreate.com
3 Jan 2008, 6:56 AM
saki, you pwn.

cobnet
3 Jan 2008, 9:23 PM
Another toot! Thanks greatly appreciated, I was just working on this one, for a grid though.

Here's a css file if you like.

Updated: I guess you can only upload zips, oh well, there are a couple file extras in there.

Thanks for taking the time to show us how it is done!

Anyone having trouble in IE with this example?

jsakalos
4 Jan 2008, 8:30 AM
Thank you. That complete css file is really great contribution.