How do I use Generator Knex outside of Datatables
How do I use Generator Knex outside of Datatables

I am very very new to the world of website development / Datatables so apologies in advance for the basic question.
I have hacked several Datatables Generator files together and everything works fine.
Two questions
My question is how can I re-use Knex to retrieve data for other use by other elements on my site.
Instead of using the 'Always visible editing panel' can I use a form to emulate the 'Create' process.
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Assuming you are constructing the Knex setup like this then whatever variable you import / require that file into would have a Knex object, so you would use it just as you would with any other Knex instance.
Probably - but it isn't something that I've tried myself, since any changes you make at the Editor level would need to be replicated in your custom form. If you do try this approach, structure the form so that it sends data to the server using the format Editor expects. Also keep in mind that our libraries were designed for use with a JSON data return - so you might need a custom controller. At that point, it would be easier just using a simple
from
to be honest!Allan