Search code examples
x-editable

X-Editable Select2 with key and value


In X-Editable using select2 tags, why can't we give key and value to select multiple values. is there any solution?


Solution

  •  $('#username').editable({
        source: [ {value: 1, text: 'Male'},
            {value: 2, text: 'Female'}],
        select2: {
            multiple: true,  // for multiple select 2 values
        },
        pk: 1, // primary key
        url: 'post.aspx',
        name: 'username'
       });