Page 1 of 1
widget atts size for lookup field

Posted:
Mon Mar 08, 2010 5:41 am
by fabiofromfrance
I am trying to change the size of a fields using
- Code: Select all
widget:atts:size=50
but it doesn't work with lookup field. Any idea why? and how to change filed size of a lookup type?
- Code: Select all
[adr_id]
widget:atts:size=50
widget:type = lookup
widget:table = adresse
Thankyou
Re: widget atts size for lookup field

Posted:
Tue Mar 09, 2010 8:45 am
by shannah
The lookup widget looks like a regular text field but is not... That said, this may be a bug... i'll look into it.
Re: widget atts size for lookup field

Posted:
Sun Aug 21, 2011 10:31 pm
by ADobkin
Has this issue been resolved? It seems like the lookup widget field size is fixed to about 20 characters, and it does not respond to the widget:atts:size directive or the other widget:atts directives.
Thanks,
Alan
Re: widget atts size for lookup field

Posted:
Mon Aug 22, 2011 1:50 pm
by shannah
No. Hasn't been fixed. You can use CSS as a workaround for now. E.g. The display field portion of the lookup widget has the CSS class:
xf-RecordBrowserWidget-displayField
-Steve
Re: widget atts size for lookup field

Posted:
Wed Aug 24, 2011 3:59 pm
by ADobkin
That works just fine, thank you. I have added this to the bug tracker as well for future reference, but I am fine with the CSS workaround in the meantime.
Re: widget atts size for lookup field

Posted:
Sun Apr 22, 2012 5:56 am
by muhyi
Hi steve, ADobkin, fabiofromfrance,
How do I make the class as discussed here? In which folder and which css file?
Re: widget atts size for lookup field

Posted:
Sat Apr 28, 2012 9:51 pm
by shannah
You can add your own CSS file in many ways. The most usual way that I do it is using the Dataface_Application::addHeadContent() method to add a <link> tag with the stylesheet in the head of the output. I usually call this from the beforeHandleRequest() method of the Application Delegate class because it runs in every request.
e.g.
- Code: Select all
function beforeHandleRequest(){
$app = Dataface_Application::getInstance();
$app->addHeadContent('<link rel="stylesheet" type="text/css" href="path/to/my/styles.css"/>');
}
-Steve
Re: widget atts size for lookup field

Posted:
Sun May 20, 2012 7:21 am
by muhyi
Many thanks, Steve, for your response. I will try and use this in my application.
Re: widget atts size for lookup field

Posted:
Sun May 27, 2012 12:05 am
by muhyi
Hi Steve.
I still can't set the width of the lookup field. I understand about the beforeHandleRequest() and the css file location. But I still can't set the proper css file for xf-RecordBrowserWidget-displayField class. The width is still the default width. Can you give me a simple example for defining this class in a css file?
Thx.
Re: widget atts size for lookup field

Posted:
Mon May 28, 2012 12:22 pm
by shannah
Change width of all lookup fields:
- Code: Select all
.xf-RecordBrowserWidget-displayField { width: 400px}
Change width of only the lookup field in the firstname field of the people table:
- Code: Select all
#people-firstname-wrapper .xf-RecordBrowserWidget-displayField { width: 400px}
-Steve