Auto complete filter with db joins

Status
Not open for further replies.

sdavies68

Member
This message relates to this closed ticket

http://fabrikar.com/forums/showthread.php?t=23956&highlight=auto-complete+width

It is correct that the size of the auto complete is based on the size of the element, however when the element is a database join and it another element as a label which is much longer/wider than the field itself, it still takes the size of the original element.

This specifically effects me on the search filters of list.

Where is this located in the php files?
 
hi

I'm not sure what exact set up you are describing? Do you have a sample page I can see to understand better?

thanks
Rob
 
Hi Rob,

Not that is publicly accessible.

I will try to re-describe the problem.

I have a list which I am viewing through front end. The list works fine. I turn on the Search elements with popup. That works fine as well. 4 of the search fields have the length of the element (being searched) field itself - so all good.

There is one element which is a databasejoin which is displayed as only 11 characters in the auto-complete field within the search. The element is defined as an INT(11) as the joined element is an integer. However the label displayed is the value of another column in that table which is a varchar(50)

For example, the element that I am using as a search filter is a databasejoin to another table using a column called "Property_ID". The value displayed for the join is the column called Address. Property_ID is int(11) the Address is a varchar(50).

In the search filters, this element is displayed with a size="20", but I want it to be size="50" the size of the joined value.

I have attached an example screenshot of the problem
 

Attachments

  • searchfield.png
    searchfield.png
    32.5 KB · Views: 249
OK, it seems that we have a 'filter_length' param we use in the element model's getFilter():

PHP:
		$size = $params->get('filter_length', 20);

... which is used to build the filter field:

PHP:
				$return[] = '<input type="text" class="inputbox fabrik_filter" name="' . $v . '" value="' . $default . '" size="' . $size . '" id="'
					. $htmlid . '" />';

... but we either never implemented it in the actual element's List Filter settings, or at some point we took it out.

So at the moment, it looks like we'll only ever create filters of 20, the default we use for the params->get().

Rob - am I missing something obvious?

-- hugh
 
odd, don't think the option ever got added to the admin interface. I've added that now so you should be able to edit the element and select an integer value for the length of the filter.
 
Status
Not open for further replies.
Back
Top