Datatables MVC .net Entity Framework
Datatables MVC .net Entity Framework
Hello, I am coming off of just using plain ole ajax to work with DataTables, but have recently decided to try out the paid editor. However, I am running into some difficulties. Currently I am trying to get it to pull info from the db, however it won't take my db context. Is there anyway to get it to work with this?
Also, is there a place I can find that show's a fully written mvc version? That way I can follow that (controller, view and model)? I imagine you call it using ajax still?
Answers
I'm not entirely sure what you mean by this point I'm afraid. Do you have a ADO.NET connection already that you want to use?
The .NET examples of Editor focus on Web API because that approach works perfectly with Editor - i.e. plain HTML and Javascript with Ajax calls to get / set data. You can use MVC style with Editor but its really just doing the same as the Web API approach with the controller returning JSON.
Regards,
Allan
Guess I'm trying to figure out how to call the controller method. Do I call the controller method that contains "new Editor()" code via ajax, or do I call it when navigating from one page to the other? Also, since this is server side, do I need $.fn.dataTable.Editor() and $("#example").DataTable() or is this all handled inside the $.fn.dataTable.Editor()?
I have my setup like below, but it is not calling my controller method LoadAdministrators().
I think you can set it as resolve. I had to get the libraries from both editor and datatables downloads to have all of the correct files. Then I had to add buttons and select to perform the way I wanted it to.
Good to hear you have it working.
To answer this specific question for anyone else reading:
Yes. The controller is invoked when DataTables and / or Editor call it via Ajax.
Allan