0
votes

I am using backpack CRUD in laravel 5.3

I have 3 models: product, country and region. And I am looking way to similar function as jquery onchange ajax call. Product crud has select for county and region. If I selected country, region select should filtered by selected country.

I don't know find crud function for this or way to insert js to edit view for one controller.

1

1 Answers

0
votes

I'm afraid there's no pre-built field that will help you. Possible solutions:

  1. create a custom field type for this purpose, starting from select2 or select2_from_ajax, that watches the change event on the first field and filters the second;

  2. include the same javascript in your public\vendor\backpack\crud\js\form.js;

I would recommend option (1), seems cleaner to me.

Hope it helps, cheers!