Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix process dependency params #10

Closed
rtwent opened this issue Apr 19, 2015 · 0 comments
Closed

Fix process dependency params #10

rtwent opened this issue Apr 19, 2015 · 0 comments
Labels

Comments

@rtwent
Copy link

rtwent commented Apr 19, 2015

Hi.
I have problems with js in version 1.4.0.
In case when the dropdown initializes in create scenario - plugin works perfect.
In update scenario I have issue with js: props is null on line 25.
My main input is:

field($reqModel, 'fk_geoid')->widget(Select2::classname(), [ 'data' => \app\models\Geo::createOptGroupTree(\app\models\Geo::getValuesForCabinet()), 'options' => [ 'placeholder' => \Yii::t('langCabinet', 'Choose location'), 'prompt' => \Yii::t('langCabinet', 'Choose location'), //'multiple' => true, 'id' => 'customersreq-fk_geoid', ], 'pluginOptions' => [ 'allowClear' => true, 'maximumInputLength' => 5 ], ]); ?>

Dependent input is:

field($reqModel, 'fk_geotopid')->widget(kartik\widgets\DepDrop::classname(), [ 'data' => ['0' => 'set'], //---default value for update scenario 'options' => ['id' => 'customersreq-fk_geotopid', 'multiple' => true], 'type' => kartik\widgets\DepDrop::TYPE_SELECT2, 'pluginOptions' => [ 'depends' => ['customersreq-fk_geoid'], //'placeholder' => \Yii::t('langCabinet', 'Choose toponomical'), 'placeholder' => false, 'url' => \yii\helpers\Url::to(['/ajaxhelpers/gettopzones']), 'initialize' => true ] ]); ?>

As I understood from .js file there is a problem with order of parameters on line 110:
self.processDep($el, value, initVal, callBack, depends);
Variable depends is passed as a callback function and will be not initialized in
setParams = function (props, vals) {}

When I rolled back to version 1.3.0 everything work great.

@kartik-v kartik-v added the bug label Apr 20, 2015
@kartik-v kartik-v changed the title dependent-dropdown.js Fix process dependency params Apr 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants