|
45 | 45 | ] |
46 | 46 | ]) |
47 | 47 | <script type="text/javascript"> |
48 | | - let organisations = {!! \VentureDrake\LaravelCrm\Http\Helpers\AutoComplete\organisations() !!} |
| 48 | + let organisations = {!! \VentureDrake\LaravelCrm\Http\Helpers\AutoComplete\organisations(true) !!} |
49 | 49 | </script> |
50 | 50 | <span wire:ignore> |
51 | 51 | @include('laravel-crm::partials.form.text',[ |
@@ -171,7 +171,6 @@ function bindClientAutocomplete(){ |
171 | 171 | @this.set('client_id',item.value); |
172 | 172 | @this.set('client_name',item.label); |
173 | 173 | @this.set('organisation_id', $(element).closest('form').find("input[name='organisation_id']").val()); |
174 | | - @this.set('organisation_name', $(element).closest('form').find("input[name='organisation_name']").val()); |
175 | 174 | @this.set('person_id', $(element).closest('form').find("input[name='person_id']").val()); |
176 | 175 | @this.set('person_name', $(element).closest('form').find("input[name='person_name']").val()); |
177 | 176 | $(element).closest('.autocomplete').find('input[name="client_id"]').val(item.value).trigger('change'); |
@@ -215,7 +214,6 @@ function bindPersonAutocomplete(){ |
215 | 214 | @this.set('person_id',item.value); |
216 | 215 | @this.set('person_name',item.label); |
217 | 216 | @this.set('organisation_id', $(element).closest('form').find("input[name='organisation_id']").val()); |
218 | | - @this.set('organisation_name', $(element).closest('form').find("input[name='organisation_name']").val()); |
219 | 217 |
|
220 | 218 | $(element).closest('.autocomplete').find('input[name="person_id"]').val(item.value).trigger('change'); |
221 | 219 |
|
@@ -266,10 +264,10 @@ function bindOrganisationAutocomplete(){ |
266 | 264 | $('input[name="organisation_name"]').autocomplete({ |
267 | 265 | source: organisations, |
268 | 266 | onSelectItem: function (item, element) { |
| 267 | + console.log(element); |
269 | 268 | @this.set('person_id', $(element).closest('form').find("input[name='person_id']").val()); |
270 | 269 | @this.set('person_name', $(element).closest('form').find("input[name='person_name']").val()); |
271 | 270 | @this.set('organisation_id', item.value); |
272 | | - @this.set('organisation_name', item.label); |
273 | 271 |
|
274 | 272 | $(element).closest('.autocomplete').find('input[name="organisation_id"]').val(item.value).trigger('change'); |
275 | 273 |
|
|
0 commit comments