Hi all, I'm taking the first steps on yii framework and datatables. I'm trying to use DataTables on yii but i'm facing this issue:. When i use this code outside Yii this is working properly.
Anyone can help me? Thanks in advance! What you have above looks fine, so my guess is that you are loading jQuery multiple times on the page. The way jQuery works is that if you load it again, it obliterates the previous version that was loaded, including any plug-ins that were attached to it.
Privacy Badger just decided that after weeks of using DataTables, it was suddenly a threat to privacy, so it quietly blocked it, resulting in several hours of debugging code that wasn't actually buggy.
Just been reading up a little about Privacy Badger. As far as I am aware, there is no reason why the CDN resources should be blocked - they don't require cookies, but I'm wondering if you were logged into the forum, since it uses a wildcard for the domain, the cookies would have been transferred. Its possible Privacy Badger didn't like that? There is an interesting discussion here. Could you try running the code that ghostwords shows and see what the output is?
Edited by Allan - Syntax highlighting.
Hi Allan, thanks. Hi tangerine, For this same reason I mentioned it. I had a similar issue in the past with highcharts: Original script: Highcharts.
I'm trying to include the datepicker for Bootstrap but am getting the following error:. Import following scripts and css files as there are used by the date picker. Learn more. Asked 3 years, 9 months ago. Active 1 year, 5 months ago. Viewed 88k times. I've looked at other cases of this error, but none match mine.
Chris Dekker. Chris Dekker Chris Dekker 1, 3 3 gold badges 9 9 silver badges 34 34 bronze badges. Please check if you have included bootstrap datetimepicker twice at the end most of the time in a file by mistake.
Active Oldest Votes. Franky Franky 2, 8 8 gold badges 35 35 silver badges 49 49 bronze badges. Take a look to source here jqueryui. That's the JQuery datepicker.
Beware of conflicts bootstrap-jquery too! I added all the necessary files. Eytibi Eytibi 7 7 silver badges 12 12 bronze badges. I had similiar problem. Djordje Vujicic 5 5 silver badges 19 19 bronze badges. Tula Hean Tula Hean 11 1 1 bronze badge. I resolved this by arranging the order in which your JS is being loaded. Abhimanyu Vyas Abhimanyu Vyas 1. If you put your init code in. You can try the following and it worked for me. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Featured on Meta. Feedback on Q2 Community Roadmap. Technical site integration observational experiment live on Stack Overflow. Dark Mode Beta - help us root out low-contrast and un-converted bits.
Question Close Updates: Phase 1. Related Datatables are widely used in many industries and by many people. Students use datatable for simpler tasks like organizing the data and visualizing the results.
Professionals in marketing and data management do more complex tasks like combining two fields, visualizing the results from tons of tables and finding new solutions through the data. Whether you are making a simple datatable or a complex datatable with different functions, there is a design for you in this bootstrap datatable example collection. While designing a bootstrap datatable, make basic things clear. Whether you are going to make a regular vertical scroll table or a horizontal scroll table.
Make a note on what are all the functions the user is going to expect from your table. If your field is going to have a lot of data related to a particular data, then make sure whether you need a single modal window or a multi-modal window. Functionalities for the rows and the columns, plus, decide whether you need a resizable column and rows. Another design factor which we have to decide is how we are going to differentiate the rows; most commonly used methods are zebra stripes, line divisions, and free from without any boundaries.
In this bootstrap datatable list we have taken care of the look and the design so that you can concentrate more on the functionalities. Experts always recommend moving from smaller elements to bigger ones when making a complex element. After taking a complete list of all the functions you need and characteristics of each and every cell on the datatable, move towards the design.
Make a rough sketch before moving on to the original design. Designer Slava Shestopalov has given a detailed insight on designing a complex web tabletake a look at it for more design related tips. Adminator is primarily a dashboard template with lots of element pre-designed for you. In this template, you get a data table and also interactive charts to visualize the data. This bootstrap datatable has all the basic functions like searching, sorting, adjusting the display density.
Right below the table, you have pagination to let the user easily jump to the table page they want. Throughout the template, the designer has maintained a professional look. If you like to have a unique pagination design for your table, take a look at our CSS pagination design collection.
All features given in this datatable are functional, hence you can concentrate on the customization part. In the previous Adminator datatable, I said you can use the chart separately to visualize the content. But in this datatable, the creator has given you a pie chart as one of the columns in the datatable. At a glance, the user can see the performance of a particular item on the table.
You can also select a particular row and can export it. Along with the export option, you also have the option to include and exclude a column with a single click. Different viewing options are also given in this datatable, which most users will love to use.
Overall it is a perfect bootstrap datatable with all the basics been done properly. The SRTDash gives us three datatable design. The functionality of all three tables remain the same, there are only a few cosmetic changes. All the tables have a fixed header design, sorting option arrows are placed right next to the header labels. At the top right corner, you have a dropdown option to control the display density, i. If the user has to deal with multiple rows, they can easily increase the display density and scan the data quickly.
Based on the design you like, pick one and start working on it to make your custom datatable. When the user has to deal with multiple tables and data, filter options will help them narrow the search result. In this template, the developer has given us the filter data based on date range and product.I've used the.
As "tangerine says its a Bootstrap error, not a DataTables one. DataTables doesn't have a collapse method see API reference. As you said yourself, its a Bootstrap method. But your idea has made me to change the order of library imports. If the Bootstrap goes after the DataTables, everything works fine.
25 Bootstrap Datatable Examples For Simple And Complex Web Tables
The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I am trying to work with jQuery's Datatable JS for my project from this link.
I downloaded the complete library from the same source. Still the rendering isn't as expected. I have still not bound any dynamic data here like within a repeater or so still it is not working. Include only one version of jQuery library version 1. This worked for me. But make sure to load the jquery. You need to load jQuery. Try to use the higher version and make sure both links have same version of jQuery.
DataTable ; inside the document. Honestly, this took hours to get this fixed. Which is just putting statement. Secondly, I had to add. Learn more. DataTable is not a function Ask Question. Asked 4 years, 9 months ago. Active 2 months ago. Viewed k times. DataTable is not a function I have still not bound any dynamic data here like within a repeater or so still it is not working. Can someone please guide me in the right direction for this problem? Abhishek Ghosh Abhishek Ghosh 1, 2 2 gold badges 19 19 silver badges 46 46 bronze badges.
Whatever the code I have written was perfectly fine, but I also got this same error. After long analysis, I just restarted my PC as I didn't restart since last 7 days. Then, my code started working. Ashokkumar: you got lucky probably! Active Oldest Votes. Multiple versions of jQuery library is loaded. AbhishekGhosh, you had an error on the screenshot jQuery is not defined before you've edited your post, I'm confident that incorrect order is the source of the problem.
Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I am trying to use the jquery plugin data tables, but I can't seem to load the function.
I keep getting this error:. I am using jQuery V. I am running other jQuery functions on the same page successfully. This is also the only. We can tell that jQuery is present, as when the document is ready, it executes the function.
Subscribe to RSS
I also tried to place the imports of the js and css file in multiple places, as suggested, but did not work. Does anyone have any clue how to fix this? Any jQuery related code needs to be included after jQuery. Similarly any code you write that uses a plugin must have the plugin loaded before your code.
Also make sure you only ever include jQuery once in a page This is because you are loading the jQuery library before loading jQuery itself. Learn more. Asked 4 years, 8 months ago. Active 4 years, 8 months ago.
Viewed 82k times. DataTable is not a function anonymous function index. Active Oldest Votes. Order of scripts is important when they are dependent on libraries or other scripts. Similarly any code you write that uses a plugin must have the plugin loaded before your code Simply switch the order so jQuery.
Thanks for the reply.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. I use DTOptionsBuilder. There is an error DTOptionsBuilder. I think the problem is because of how I include the libraries.
I followed the guide, but I don't know why it still does not work. I found out that I need to put. Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up. New issue. Jump to bottom. Copy link Quote reply. The versions I am using jquery version: 1. Thanks for your hard work! This comment has been minimized. Sign in to view. Have you checked if you included the datatables. Thanks Phuwin this is working for me. Sign up for free to join this conversation on GitHub.