I encountered a interesting display bug when working with EXTJS recently. The following code renders well in FF 2 and above but not in IE6.
var form = new Ext.form.FormPanel({
baseCls: 'x-plain',
labelWidth: 140,
url: 'abc/def.php',
defaultType: 'textfield',
items: [{
fieldLabel: 'Name',
name: 'name',
anchor:'100%' // anchor width by percentage
}, {
xtype: 'textarea',
fieldLabel: 'Description',
name: 'description',
anchor: '100% -30' // bug in IE6
}]
});
var window = new Ext.Window({
title: 'Some Window',
width: 500, height: 300,
layout: 'fit',
plain: true,
buttonAlign: 'center',
items: form
});
window.show();brian.moeskau from the EXTJS forums was kind enough to answer this problem. The fix is a piece of code that primes the width of the controls to prevent it from overflowing out of the window/panels. The code is as follows
Ext.override(Ext.form.Field, {
adjustWidth : function(tag, w){
tag = tag.toLowerCase();
if(typeof w == 'number' && !Ext.isSafari){
if(Ext.isIE && (tag == 'input' || tag == 'textarea')){
if(!Ext.isStrict){
return this.inEditor ? w : w - 3;
}
if(tag == 'input' && Ext.isStrict){
return w - (Ext.isIE6 ? 4 : 1);
}
if(tag == 'textarea' && Ext.isStrict){
return w-4;
}
}else if(Ext.isOpera && Ext.isStrict){
if(tag == 'input'){
return w + 2;
}
if(tag == 'textarea'){
return w-2;
}
}
}
return w;
}
});I hope this will solve other people’s problems too!
HOWTO: Codeigniter, IIS and ISAPI_Rewrite
Author: gaweee | Filed under: development, howtoPretty URLs on IIS is possible. Not so much to make it pretty but to make it convenient when testing your system. Its really simple too!
below is my configuration for a codeigniter virtual directory called firingrange
RewriteRule ^/firingrange/(images|css|files|js)(.*)$ /firingrange/webroot/$1$2 [L] RewriteRule ^/firingrange/$ /firingrange/index.php [L] RewriteRule ^/firingrange/index.php$ /firingrange/index.php [L] RewriteRule ^/firingrange/index.php?(.*)$ /firingrange/index.php?$1 [L] RewriteRule ^/firingrange/(\w+).php$ /firingrange/webroot/($1).php [L] RewriteRule ^/firingrange/(.+)\?(.*)$ /firingrange/index.php?$1&$2 [L] RewriteRule ^/firingrange/(.*)$ /firingrange/index.php?$1 [L]
Just like the mod_rewrite HOWTO, I threw all my static files into webroot folder so that you can access the site via http://t.wits.g/images/myimage.jpg easily. Same goes for css and js.
HOWTO: Migrate your svn repository between servers
Author: gaweee | Filed under: development, howtosvnadmin dump /path/to/somerepository < somerespositry.svn.backup
The resulting file can be pretty large. Its basically a file of all your snapshots. Needless to say, if you’re at revision 300, be prepared to wait.
login to the new server to create the repository
svnadmin create /path/to/newrespository
Double check the created directory structure where possible, many a times my svn folders arent created with the correct group write permissions. So remote commits encounters transaction errors
svnadmin load /path/to/newrepository < somerepository.svn.backup
And you’re done! really simple wasnt it?
I cant remember the last time i got mod_rewrite to just work. I think i know regex, i think i know how http request works, i think i know some mod_rewrite. I try. For sure it breaks. This is undeniable proof that good things ONLY come to those who sweat and strain their necks…
The following is my mod_rewrite ruleset for codeigniter
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} (index\.php|webroot/|images/|css/|js/|robots\.txt|favicon\.ico)
RewriteRule ^(images|css|files|js)/(.*)$ webroot/$1/$2 [L]
RewriteRule ^(favicon\.ico)$ webroot/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]I threw all my static files into webroot folder so that you can access the site via http://t.wits.g/images/myimage.jpg easily. Same goes for css and js.
So now you can access your controllers through the preferred pretty url: http://t.wits.sg/welcome
I’ll go hack the router.php file someday when i’m free enough so that it can accept GET requests too.
mklink: no longer just a vista tease
Author: gaweee | Filed under: developmenti was working with .net dev studio and was trying to figure out how to make several projects share a common folder of master files. So we came across mklink. For all you folks out there rushing to open your command prompt in anything lesser than Vista, give it up, it aint gonna work. Vista onwards only baby~
The method signature is as follows:
MKLINK [[/D] | [/H] | [/J]] Link Target
/D Creates a directory symbolic link. Default is a file
symbolic link.
/H Creates a hard link instead of a symbolic link.
/J Creates a Directory Junction.
Link specifies the new symbolic link name.
Target specifies the path (relative or absolute) that the new link refers to.I posted on how the tool didnt allow directories to be hard linked previously.
Correction: directories can be symbolic linked that will be resolved by the filesystem. The confusion there was when a symbolic link is created, it looks no different from a shortcut on explorer. Giving doubt to whether it would hold its ground when accessed programmatically instead of via the explorer.
Thanks Alex for pointing this out!
Most Popular
- HOWTO: PHP and jQuery upload progress bar (48)
- JQuery Progress Bar 1.1 (42)
- Howto: Repackageable custom extension development in Magento - Part 2 - Admin Controller (24)
- Howto: Repackageable custom extension development in Magento - Part 8 - CRUD - Update (16)
- HOWTO: struts 2 i18n (13)
- JQuery Progress Bar 2.0 (12)
- JQuery Progress Bar 1.2 (11)
- Howto: Repackageable custom extension development in Magento (9)
- Howto: Repackageable custom extension development in Magento - Part 3 - Database (9)
- Howto: Repackageable custom extension development in Magento - Part 9 - Frontend - List (8)
Recent Comments
- vid: @john: Unfortunately there has been
- john: With facebook's growth, more and
- vid: Thanks for the mention Josefina
- vid: Thanks Remo. The idea was
- Remo: Oh man not again. This
- learning methods: All the posts you talk
- best travel agency: Wow! I really enjoyed this
- Muzafar Ali: Hi, thanks for sharing a beautiful
- andy65007: After the progress bar
- Mark: Excellent tutorials. Most "how to
Latest Entries
- Attack of the Facebook Harvesters
- jQuery Progress Bar Configuration
- Extracting email addresses from inbox
- 10 Good (Free and Legal) Source for Photos and Images
- Howto: Backup Microsoft SQL Server Database, as in Dump it to a SQL Script (like MYSQL's sqldump)
- Managing client's expectation with wireframe software
- Howto: Repackageable custom extension development in Magento - Part 9 - Frontend - List
- JQuery Progress Bar 2.0
- HOWTO: Find icons for your new prototype system
- Google Maps Helper