Bootstrap tags input - Can't add objects when itemValue option is not set
<p>I have several divs and tagsinput area, where i want to store their titles by click. So I have this code to initialize tagsinput:</p>

<pre><code>$('#chosen-works-list').tagsinput({
   allowDuplicates: false,
   tagClass: 'label label-primary',
   itemValue: 'id',
   itemText: 'text'
});
</code></pre>

<p>and this to add titles to tagsinput:</p>

<pre><code>$('.file').click(function() {
   $(this).toggleClass('file-unchosen file-chosen');
   function addWork(elem) {
      var workname = $(elem).find('.file-name-title').text();
      var workid = $(elem).parent().data('number').toString();
      $('#chosen-works-list').tagsinput('add', { id: workid, text: workname });
   };
   addWork(this);
});
</code></pre>

<p>But I got error "Can't add objects when itemValue option is not set" (despite i set itemValue option like it was adviced in other stackoverflow-topics). What am I doing wrong?</p>