jquery-select2

'list' object has no attribute 'queryset' error when adding a autocomplete field to a model-form

寵の児 提交于 2019-12-08 13:43:10
问题 I want to add an another autocomplete field to my model.form. However, as soon as I add the autocomplete widget for the field "projektnummer" 'projektnummer': autocomplete.ModelSelect2(url='output:projekt-form-autocomplete'), I get an wired template error I cannot make sense of. Do you have some ideas what I can do here? Thank you very much! :) error message: AttributeError at /output/create/ 'list' object has no attribute 'queryset' Request Method: GET Request URL: http://127.0.0.1:8000

using select2 gem with acts_as_taggable gem on rails

感情迁移 提交于 2019-12-08 11:44:30
问题 Im using select2-rails gem in my rails app. I found a problem here: Problem in tag_list. As u see it starts with ["",...] what wrong. Because of this my tag_list became empty after submitting. Without select2 it works fine. Can any one help? My erb code <%= f.label :tag_list, "TAGS" %><br> <%= f.select :tag_list, options_for_select([['Asst', 'As'], ['Mouse', 'Mm'], ['Yeast', 'Sc']]),{},:multiple => true, :class =>"category" %> 回答1: There are two problems here: 1) the tag_list parameter is not

select2 createSearchChoice id from post

ぐ巨炮叔叔 提交于 2019-12-08 08:03:52
问题 I am using select2 as a tagging input , but i am stumped when it comes to handling the creation of new tags and getting the new tag id's back into the select2 this question is closely related Select2.js: why is id the same as text on change for removed? and you can see from his jsfiddle http://jsfiddle.net/7e8Pa/ , when text is not found in the createSearchChoice, new option is created, id:-1, text:term, then in the on change event, altering that id to 5 I need to be able to submit a $.post

Select2 Multiple: Add several items with one copy+paste

会有一股神秘感。 提交于 2019-12-08 07:44:34
问题 I want to add several items in a select2 input field at once. If I copy+paste "Hawaii Alaska" into the select-multiple example here, then I get: No results found In my case spaces are not allowed in the items. Is there a way to insert N space sperated items via copy+paste? Desired result: (x)Hawaii (x)Alaska 回答1: you can add token separators in your select2 to identify characters as stopping points for your tags/choices, but unfortunately it bugs on the last copy pasted item //try copy

AngularUI select2 onChange method

半腔热情 提交于 2019-12-08 06:45:55
问题 How do I go about doing something along these lines: <select ui-select2 multiple="true" on-change="onChange()" data-ng-model="select2Model"></select> where in my controller, I have the onChange(select2OnChangeData) defined. I tried adding this scope: { model: "=ngModel", onChange: "&onChange" }, to angular-ui, but that changed the scope variable and broke the rest of the functionality. I'd really like to refrain from doing: .on("change", function(e) 回答1: Good thing I did just this in my

select2: Disable case-sensitive matches

你离开我真会死。 提交于 2019-12-08 06:45:52
问题 I'm trying to allow only one value within select2 library, no matter how it's written. For example if the value "Test" is in the data list, "test" should not be added again. I've searched for a while and also looked at the documentation, but I didn't solve this one. $("#timezones").select2({ tags: true, createTag: function (tag) { return { id: tag.term, text: tag.term + " (new)", isNew: true }; }, matcher: function (term, data) { // `term.term` should be the term that is used for searching //

Loading Remote Data in Select2

ε祈祈猫儿з 提交于 2019-12-08 06:02:28
问题 I am using Select2's Loading Remote Data Functionality .The problem is that data is not getting loaded on the dropdownlist .On keypress remote function is getting called and data is returning properly,but its not showing in dropdownlist. HTML <div class=" form-group col-md-4" data-url="@Url.Action("GetStudentWalkInnName")" id="WalkinnName"> <div> <label for="txtEmployee" class=" control-label"> Name </label> </div> <div> <select class="form-control " id="ddlName"></select> </div> </div>

Backbone/Marionette with select2 v4.0, editing the tags

喜欢而已 提交于 2019-12-08 05:20:59
问题 I have this fiddle which is an extension of the Backbone/Marionette playground fiddle. I included select2 js and css files. Is it possible to edit a tag that is not the last tag? You can edit by backspacing in the box, but it only lets you touch the last one. I would like it to act like a gmail 'to' list where you can double click on one and edit it, then it goes back to a tag on blur. this.$('#foo').select2({ data: [{ id: 1, text: "test1.com" }, { id: 2, text: "test2.com" }], multiple: true,

Select2 generating id with ajax response data

旧街凉风 提交于 2019-12-08 04:12:16
问题 My JSON response data does not contain an ID field, which is required by Select2 in order to display results. In the documentation they provide a way to generate id, however, I was unable to do so. Can someone provide an example on how to do this? I have tried this so far: $('.itemSearch').select2( ajax: { type: "POST", url: '/Default.aspx/TestMethod', data: function(params){ var query={ message:params.term } return JSON.stringify(query); }, processResults: function (data) { var data1 = $.map

Select2 JQuery issue with ASP.NET UpdatePanel

♀尐吖头ヾ 提交于 2019-12-08 04:03:53
问题 Have a existing solution I have been asked to enhance with Select2 JQuery library. Have an updatepanel with a save button. On that updatepanel is a ASP.NET DropDownList . on document ready I issue $('.dropdownspecificclass').select2(); When page first renders it looks as expected the DropDownList has that tags view that Select2 provides. Click the save button and the save process is done async without a page refresh, but the Select2 dropdown list loses it Select2 styling and now just looks