Select2 on filter options
This commit is contained in:
parent
35ec93e161
commit
c3ea6dd433
3 changed files with 11 additions and 6 deletions
|
@ -21,10 +21,13 @@
|
|||
//= require_tree .
|
||||
|
||||
ready = function() {
|
||||
$(".select2-selector").select2({
|
||||
width: 'resolve',
|
||||
placeholder: "Ontvanger"
|
||||
});
|
||||
$.each($(".select2-selector"), function(index, val) {
|
||||
$(val).select2({
|
||||
width: 'resolve',
|
||||
placeholder: $(".select2-selector")
|
||||
});
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
$(document).ready(ready)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
= f.select :creditor,
|
||||
options_from_collection_for_select(User.all.order(:name), :name, :name),
|
||||
{ include_blank: true },
|
||||
{ class: 'select2-selector form-control', size: 50, required: true }
|
||||
{ class: 'select2-selector', size: 50, required: true, data: { placeholder: "Creditor" } }
|
||||
= f.text_field :message, placeholder: "Message", size: 75, class: "form-control", required: true
|
||||
.input-group
|
||||
%span.input-group-addon
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
.row
|
||||
.col-md-4
|
||||
.input-listen{ 'data-input-type': 'text', 'data-filter-name': 'Issuer' }
|
||||
%input{type: 'text', placeholder: 'Filter on Issuer', class: "form-control" }
|
||||
= grouped_collection_select :nil, :nil, [User, Client], :all, :name, :name, :name,
|
||||
{ include_blank: true },
|
||||
{ data: { placeholder: "Filter on Issuer" }, class: "select2-selector form-control" }
|
||||
.col-md-4
|
||||
.input-listen{ 'data-input-type': 'text', 'data-filter-name': 'Peer' }
|
||||
%input{type: 'text', placeholder: 'Filter on Peer', class: "form-control" }
|
||||
|
|
Loading…
Reference in a new issue