Ok, i figured out my mistake if anyone else is interested. I declare the
first filteringSelect as follows:
$this->addElement(
'FilteringSelect',
'select_1',
array(
'label' => 'Label 1 (select)',
'autocomplete' => true,
'dijitParams' => array(
'required' => false,
'pageSize' => 10,
),
'storeId' => 'myStore',
'storeType' => 'dojo.data.ItemFileReadStore',
'storeParams' => array(
'url' => '/mypath/to/mydata/format/ajax',
'method' => 'get',
),
'searchAttr' => 'name',
)
);
Then for the subsequent filteringSetects I define them as follows:
$this->addElement(
'FilteringSelect',
'select_2',
array(
'label' => 'Label 2 (select)',
'autocomplete' => true,
'store' => 'myStore',
'dijitParams' => array(
'required' => false,
'pageSize' => 10,
),
)
);
Everything now works as it should. Multiple FilteringSelects, one datastore,
and one server call to populate it. My mistake was that I was using
'storeId' instead of 'store' in the subsequent filteringSelect declarations.
Barry
barry hembree wrote:
>
> Hi All,
>
> I'm trying to create a form that has several FilteringSelect boxes
> attached to one ItemFileReadStore. If I were to do this in Dojo/HTML I
> would create the readStore like this:
>
> <div dojoType = "dojoItemFileReadStore"
> url = "path/to/method/in/my/model"
> jsId = "myStoreId"
> />
>
> and then attach it to the FilteringSelect boxes.
>
> How do I do this with ZF. I tried creating the FilteringSelects all
> referencing the same storeId. That seems to work after a fashion. If I
> look at the DOM for the created form, there appears to be only one
> dataStore but if I look at the console when the page is created, a call is
> sent to the controller to create the dataStore everytime it is referenced.
> So if i have 5 filteringSelects, I create the same store 5 times. Is there
> a way in ZF to create the store and then attach it to the
> filteringSelects?
>
> Thanks for your help.
>
> Barry
>
>
--
View this message in context:
http://www.nabble.com/Multiple-FilteringSelects-one-dataStore-tp21935281p21939115.html
Sent from the Zend Framework mailing list archive at Nabble.com.