Note that there are some explanatory texts on larger screens.

plurals
  1. POSearching on a value and displaying another on Dojo FilteringSelect
    primarykey
    data
    text
    <p>I'm using the dojo FilteringSelect element together on a Zend form, but I cannot make it work as I want. I have a store with three fields <code>id</code>, <code>label</code>, <code>name</code>. Label will be used for the dropdown and should <strong>also</strong> be used for the search, while <code>name</code> should be used for te display inside the box. The problem is that I can't find a way to make this behavior work.</p> <p>Setting the <code>labelAttr</code> value to <code>label</code> works showing it on the dropdown, but the <code>searchAttr</code> attribute governs both the search AND the display on the input box once a value is selected. I need to search the <code>label</code> field since it is a collection of many fields, but display the value on <code>name</code>, is it possible?</p> <p>EDIT: @RichardAyotte The Dijit FilteringSelect widget uses a dojo.data.store, which is basically a javascript object, where each item is also an object with many parameters. You can set two special parameters on the store: <strong>labelAttr</strong> and <strong>searchAttr</strong> which will define a couple of behaviors. The FilteringSelect is tied to an INPUT box where you can search. If you click the box it will open the list of options, like a <strong></strong> would. Here it shows whatever you defined as labelAttr. Now, if you type on the box, it will <em>search</em> on the store, using what is defined on the <strong>searchAttr</strong> field. It ALSO used the value of label to be display inside the input once you select something from the list (you can check it here <a href="http://dojotoolkit.org/reference-guide/1.9/dijit/form/FilteringSelect.html#displaying-rich-text-menu-labels-with-labelattr-and-labeltype" rel="nofollow">http://dojotoolkit.org/reference-guide/1.9/dijit/form/FilteringSelect.html#displaying-rich-text-menu-labels-with-labelattr-and-labeltype</a>)</p> <p>What I wanted to do is "decouple" the <strong>searchAttr</strong> field into 2 different fields one for search and another to be used for display inside the input. AFAICT it is not possible though, and I will have to extend the FilteringSelect object</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload