1. Download jquery from “https://jquery.com/download/“
2. Download jquery-ui from “https://jqueryui.com/“
3. Link all the js and css files in both jQuery and jQuery-ui to the templates (html pages)
<link href="{% static 'js/jquery-ui-1.12.1/jquery-ui.min.css' %}" rel="stylesheet">
<link href="{% static 'js/jquery-ui-1.12.1/jquery-ui.structure.min.css' %}" rel="stylesheet">
<link href="{% static 'js/jquery-ui-1.12.1/jquery-ui.theme.min.css' %}" rel="stylesheet">
<script src="{% static 'js/jquery-3.4.0.min.js' %}"></script>
<script src="{% static 'js/jquery-ui-1.12.1/jquery-ui.js' %}"></script>
<script src="{% static 'js/myjs.js' %}"></script>
4. Create a custom.js file in static/js folder where you will specify all your js codes. In this file, add the following codes:
$(document).ready(function(){
$(".datetimeinput").datepicker({changeYear: true,changeMonth: true, dateFormat: 'yy-mm-dd'});
});
please give me a video tutorial about this
I have some delay be the video will be up today InshaAllah
Hi Arbadjie, I have a question. I am wondering if its possible to make the stock management app usable by different users each keeping their own data? like if someone registers on the website they will find blank tables, and they can put their own data. basically supporting different users to use it say from different companies for example. Currently, i have different users accessing the same tables and data. But i want each user to create their own data. How can that be achieved?
I have followed your date picker tutorial but my is not working and not showing date picker calendar.
You might need to do a control refresh
i do a control refresh also, still not working
In my HTML template:
In my forms.py:
class StockHistorySearchForm(forms.ModelForm):
export_to_CSV = forms.BooleanField(required=False)
start_date = forms.DateTimeField(required=False)
end_date = forms.DateTimeField(required=False)
class Meta:
model = StockHistory
fields = [‘category’, ‘item_name’, ‘start_date’, ‘end_date’]
in template :
i am getting below error in the console in developer tools:
jQuery.Deferred exception: $(…).datepicker is not a function @http://localhost:8000/static/js/myjs.js:3:22
e@http://localhost:8000/static/js/jquery-3.5.1.min.js:2:30005
l/</t<@http://localhost:8000/static/js/jquery-3.5.1.min.js:2:30307
undefined
i am not getting date:-
here is the error
Failed to load resource: the server responded with a status of 404 (Not Found)
bootstrap.bundle.min.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
jquery-3.6.0.min.js:2 jQuery.Deferred exception: $(…).datepicker is not a function TypeError: $(…).datepicker is not a function
at HTMLDocument. (http://localhost:8000/static/js/myjs.js:3:23)
at e (http://localhost:8000/static/js/jquery-3.6.0.min.js:2:30038)
at t (http://localhost:8000/static/js/jquery-3.6.0.min.js:2:30340) undefined
S.Deferred.exceptionHook @ jquery-3.6.0.min.js:2
jquery-3.6.0.min.js:2 Uncaught TypeError: $(…).datepicker is not a function
at HTMLDocument. (myjs.js:3)
at e (jquery-3.6.0.min.js:2)
if someone has solved these error plz tell
Verify that you have downloaded the right static files in the static folder and that you have referenced them properly in your templates
Hi Arbadjie,
I am following your tutorials and they are really really helpful. I want to know that how can we add the new categories without going into the admin page?
Please reply.
Hi there Arbadjie,
Really enjoy your tutorials!
Quick question, im having trouble with the jquery implementation, I’ve followed all of your steps but when it comes to declaring the static files of jquery it just doesn’t seem to work on my local host. The sad part is that I cant seem to find an error at all other than the modal for the dates not showing up.