This is supposed to be easy and 5 minute implementation......Not!!!!!
This is supposed to be easy and 5 minute implementation......Not!!!!!
I am using MVC 4 with razor C#. I followed the tutorial and was unable to get it to render. No search bar or buttons. Nothing but the filler data. On https://datatables.net/ there are more instructions. There is a download of the Datatable zip. There is the reference of juery and css. Then table formating. Still won't render. I thought it was jquery conflicts which would take forever to sort through them. The DataTable-1.10.8 download now appears in my solution so all the scripts and css would have to be moved to the appropriate folders. This has become a nightmare and I need the project complete today.I opened an empty webform project to start from scratch, still no go. How did you render this that easily. Help Please!
Answers
What tutorial? What do you mean by "unable to get it to render"? How far have you got? Are you getting any error messages? What does your code look like?
What tutorial? Here is the tutorial I used https://www.youtube.com/watch?v=GA03MzN9QFg and I followed the installation instructions on this site. Neither worked. Look how easily he implemented DataTable.
What do you mean by "unable to get it to render"? I have filler data loaded into my view, but jquery will not render the searchbox, pager or any of features of the example tables.
How far have you got? I have done everything listed on this page exactly. https://datatables.net/manual/installation
Are you getting any error messages? In inspect element under console I am getting 'Failed to load resource' for the css and the jquery. Im using the latest versions of all css and jquery.
What does your code look like? Too long to place view and _layout folder.
Index.chtml View
```
<link rel="stylesheet" type="text/css" href="/DataTables-1.10.8/media/css/jquery.dataTables.css">
$(document).ready(function () { $('#example').dataTable(); });<br>
Press Submit and check console for URL-encoded form data that would be submitted.
Submit
Data submitted to the server:```
_Layout
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - My ASP.NET MVC Application</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
<link href="~/Content/easyquery.css" rel="stylesheet" />
<link href="~/Content/eqview.css" rel="stylesheet" />
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/themes/base/css")
@Scripts.Render("~/bundles/modernizr")
</html>
You are using some sort of templating engine that make it impossible for anyone here to see what's actually happening. Where is the #example table container in your sample?
I apologize for the earlier posting. I was able to render the datatable, but now I have discovered it is purely data driven by unfamiliar means. I am new to ajax and json data objects and web services. I'm using ado.net methods with sql data adapters and readers to get my data. I was looking for a quick implementation of a table with use of ado.net means of fetching data to and from sql server. Don't have time to figure out web service and ajax given the project is due tomorrow.