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

Can't use string in select option value. #23

Open
akramrana opened this issue Apr 22, 2017 · 0 comments
Open

Can't use string in select option value. #23

akramrana opened this issue Apr 22, 2017 · 0 comments

Comments

@akramrana
Copy link

yii2-x-editable select2 ,
if i use string in option value, the plugins itself convert that value to time string . like i have select box which has 2 option S=> Simple, G=> Grouped. while i change the option its convert S or G to time string.
its strange issue.in your XEditable class saveAction what are the use of that code.

if (strtotime($value))
{
	$model->$name = strtotime($value);
}else{
	$model->$name = $value;
}

i have remove that strtotime($value) block ... now its working. it will much appreciated if you let me know what is the use of it .

also in XEditableColumn class you hard coded the primary key public $pk = 'id';.
if primary key is not ID, now plugins throwing error , i think you can handle it by

   ```

$primaryKey = $model->primaryKey();
$this->pk = $primaryKey[0];


Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant