-
I've tried so many things to get a simple AJAX call to work. I have a table of session records and one of the columns is whether it is test data or not. I'd like to be able to click that field to toggle it on and off. Right now, I'm using overriding the column to render the value as a buttons that trigger the form submit to a specific route. SingleCompanyScreen.php The relevant functions in SingleCompanyScreen.php are
` The problem with this approach From submit(event) in form_controller.js
` Basically, because it's submitted, it's rejected all other clicks. And because this is a table with hundreds of values, I need to be able to click multiple times (without reloading). I've also tried
What is the best practice in Orchid to click a button > send data to the server > receive a response (I assume Turbo) > update only that element without refreshing the screen. All help would be appreciated. I'm totally stuck. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I've got it working (badly). Basically, I've added However, I would still like to know the official way of doing this. |
Beta Was this translation helpful? Give feedback.
-
I've sorted it out. I sorted it out. For anyone else who's having a similar challenge, this is what I did.
Append to resources/js/app.js (the Orchid website instructions say dashboard.js, but app.js exists instead)
Edit config/platform.php
I then had to update my dev machine to the latest version of node and npm. I needed to do that in order to run
on the server (I also added that to my build scripts)
|
Beta Was this translation helpful? Give feedback.
I've sorted it out.
I sorted it out. For anyone else who's having a similar challenge, this is what I did.
In resources/js/controllers/flip.js
Note: I'm extending ApplicationController (which is loaded as window.Controller) to access the native Orchid AJAX call (loadStream).
Append to resources/js/app.js (the Orchid website instructions say dashboard.js, but app.js exists instead)