Issues

ZF-10931: Duplicate Dojo Data Store when using identical jsId

Issue Type: Bug Created: 2011-01-10T01:11:41.000+0000 Last Updated: 2011-01-10T01:11:41.000+0000 Status: Open Fix version(s): Reporter: Webdevilopers (tridem) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dojo

Related issues: Attachments:

Description

In some cases you may want FilteringSelects or ComboBoxes to share the same store. The following code creates two FilteringSelects using the same store by setting the same id.

<pre class="highlight">
<?= new Zend_Dojo_Form_Element_FilteringSelect(
    'id1',
    array(
        'label' => 'ID1',
        'storeId'   => 'fooStore',
        'storeType' => 'dojo.data.ItemFileReadStore',
        'storeParams' => array(
            'url' => '/dojo/grid/data'
        ),
        'dijitParams' => array(
            'pageSize' => 5,
            'autocomplete' => 'false',
            'queryExpr' => '*${0}*'
        )
    )
); ?>

<?= new Zend_Dojo_Form_Element_FilteringSelect(
    'id2',
    array(
        'label' => 'ID2',
        'storeId'   => 'fooStore',
        'storeType' => 'dojo.data.ItemFileReadStore',
        'storeParams' => array(
            'url' => '/dojo/grid/data'
        ),
        'dijitParams' => array(
            'pageSize' => 5,
            'autocomplete' => 'false',
            'queryExpr' => '*${0}*'
        )
    )
); ?>

The generated code creates two separate stores with the same id.

<pre class="highlight">
ID1

``

ID2

``

This doesn't seem to be critical for dojo (yet). Maybe there is a way for the dojo view helper to check if the jsId for the store has already been set and eventually throw out an error.

If a second element uses an existing id the element should automatically get the same parameters for the store. In this case you only have to set the storeId an leave out the storeParams which are required at the moment.

Comments

No comments to display

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts