widget atts size for lookup field

A place for users and developers of the Xataface to discuss and receive support.

widget atts size for lookup field

Postby fabiofromfrance » Mon Mar 08, 2010 5:41 am

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
fabiofromfrance
 
Posts: 14
Joined: Mon Feb 15, 2010 3:03 pm

Re: widget atts size for lookup field

Postby shannah » Tue Mar 09, 2010 8:45 am

The lookup widget looks like a regular text field but is not... That said, this may be a bug... i'll look into it.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: widget atts size for lookup field

Postby ADobkin » Sun Aug 21, 2011 10:31 pm

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
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA

Re: widget atts size for lookup field

Postby shannah » Mon Aug 22, 2011 1:50 pm

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: widget atts size for lookup field

Postby ADobkin » Wed Aug 24, 2011 3:59 pm

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.
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA

Re: widget atts size for lookup field

Postby muhyi » Sun Apr 22, 2012 5:56 am

Hi steve, ADobkin, fabiofromfrance,

How do I make the class as discussed here? In which folder and which css file?
muhyi
 
Posts: 3
Joined: Sun Apr 22, 2012 5:47 am

Re: widget atts size for lookup field

Postby shannah » Sat Apr 28, 2012 9:51 pm

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: widget atts size for lookup field

Postby muhyi » Sun May 20, 2012 7:21 am

Many thanks, Steve, for your response. I will try and use this in my application.
muhyi
 
Posts: 3
Joined: Sun Apr 22, 2012 5:47 am

Re: widget atts size for lookup field

Postby muhyi » Sun May 27, 2012 12:05 am

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.
muhyi
 
Posts: 3
Joined: Sun Apr 22, 2012 5:47 am

Re: widget atts size for lookup field

Postby shannah » Mon May 28, 2012 12:22 pm

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved