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

setValue() for multiples items in checklist, works, but dont displays values. #1048

Open
antoniocury opened this issue Sep 21, 2017 · 0 comments

Comments

@antoniocury
Copy link

Hi guys!
I'm trying set multiples values in an X-editable field dynamically, the 'data-type' of my field is an "checklist".

My logic is here:

<html>
<a href="javascript:;" id="TestField" data-type="checklist" data-source="[{value:'1',text:'Test one'},{value:'2', text:'teste two'},{value:'3', text:'Test three'}]" class="editable editable-click">Empty</a>

<button type="button" class="btn btn-default" id="btnMultiples">Set multiples values</button>
</html>
<script>
$('#TestField').editable({
    mode: 'inline'
});

$('#btnMultiples').on('click', function(e){
	$('#TestField').editable('setValue', '2'); //Working
$('#TestField').editable('setValue', '2,3'); //Working, check items, but don't display the values in link field, is ever 'Empty'
});
</script>

Thank in advance and sorry for my english, i'm learning.

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