-
1 Apr 2009 4:40 PM #1
Adding separator in between formpanel fields
Adding separator in between formpanel fields
Hi,
I want to add a horizontal line between fields in a formpanel.something similar to a menu separator.
I dont want a fieldset which makes a border around the field.i tried using a '-' in the items config.its giving errors.
for ex:
Company Name : <Ext TextField>
---------------------------------------------- line separator
Company Address : <TextField>
----------------------------------------------
Hope u got the point.please help
thanks.
-
1 Apr 2009 5:03 PM #2
This is an idea.
1pxLine.gif is a 1x1 pixel image.
Code:Ext.BLANK_IMAGE_URL = '/js/ext/resources/images/default/s.gif'; Ext.onReady(function () { var lineconfig = { xtype: 'box', autoEl:{ tag: 'div', style:'line-height:1px; font-size: 1px;margin-bottom:4px', children: [{ tag: 'img', src: '1pxLine.gif', height: '2px', width: '100%' }] } }; var formp = new Ext.FormPanel({ title: 'Example form', renderTo: Ext.getBody(), width: 500, defaults: { xtype: 'textfield' }, items: [{ fieldLabel: 'Label 1' },lineconfig,{ fieldLabel: 'Label 2' },lineconfig,{ fieldLabel: 'Label 2' }] }); });Last edited by zig999; 1 Apr 2009 at 5:27 PM. Reason: posted a new version with some style added
-
1 Apr 2009 6:19 PM #3
Adding Separator in formpanel
Adding Separator in formpanel
Thanks,
Do u have the gif ? can u please provide it?
-
1 Apr 2009 9:47 PM #4
check this. Untested
Code:Ext.ns("Hulas.ux"); Hulas.ux.line = Ext.extend(Ext.Component, { autoEl: 'hr' }); Ext.reg('line', Hulas.ux.line); var formp = new Ext.FormPanel({ title: 'Example form', renderTo: Ext.getBody(), width: 500, defaults: { xtype: 'textfield' }, items: [{ fieldLabel: 'Label 1' },{ xtype: 'line' },{ fieldLabel: 'Label 2' },{ xtype: 'line' },{ fieldLabel: 'Label 2' }] });Shibu Bhattarai
Use JavaScript beautifier to beautify you code http://jsbeautifier.org/
Code Conventions http://javascript.crockford.com/code.html
ExtJS Core Manual http://extjs.com/products/extcore/manual/
-
3 Apr 2009 5:20 AM #5
-
3 Apr 2009 11:32 AM #6
Why don't you just use css?
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

