Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery datatables bundleconfig for MVC4?

Nuget installing jQuery DataTables -1.9.4 in separate folders in VS 2012. See pic. How to bundle up them with existing bundleConfig?enter image description here

Current bundle I have is

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));
   bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                    "~/Scripts/jquery-ui-{version}.js"));
   bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));
   bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));
   bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
   bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                        "~/Content/themes/base/jquery.ui.core.css",
                        "~/Content/themes/base/jquery.ui.resizable.css",
                        "~/Content/themes/base/jquery.ui.selectable.css",
                        "~/Content/themes/base/jquery.ui.accordion.css",
                        "~/Content/themes/base/jquery.ui.autocomplete.css",
                        "~/Content/themes/base/jquery.ui.button.css",
                        "~/Content/themes/base/jquery.ui.dialog.css",
                        "~/Content/themes/base/jquery.ui.slider.css",
                        "~/Content/themes/base/jquery.ui.tabs.css",
                        "~/Content/themes/base/jquery.ui.datepicker.css",
                        "~/Content/themes/base/jquery.ui.progressbar.css",
                        "~/Content/themes/base/jquery.ui.theme.css"));
like image 299
James123 Avatar asked Mar 14 '13 19:03

James123


People also ask

How to use jQuery DataTables plugin with MVC Razor?

An HTML Table will be applied the jQuery DataTables plugin and then using a jQuery AJAX call the data will be fetched from the Controller and will be assigned to the jQuery DataTables plugin in ASP.Net MVC Razor. Database Here I am making use of Microsoft’s Northwind Database. You can download it from here. Download and install Northwind Database

What is jQuery DataTable?

What is jQuery Datatable? DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement, and will add advanced interaction controls to any HTML table. -> It is free and open source library.

How to connect Northwind database with Entity Framework using MVC?

The very first step is to create an ASP.Net MVC Application and connect it to the Northwind Database using Entity Framework. For more details please refer my article ASP.Net MVC: Simple Entity Framework Tutorial with example. Following is the Entity Data Model of the CustomersTable of the NorthwindDatabase which will be used later in this project.


1 Answers

You can just add the appropriate lines to the .css bundle and .js bundle

.JS

"~/Scripts/DataTables-1.9.4/media/js/jquery.dataTables.js",

.CSS

"~/Content/DataTables-1.9.4/media/css/jquery.dataTables.css",
like image 189
MichaelF Avatar answered Oct 07 '22 00:10

MichaelF