Senaid You're awesome! The way you proceed , the way you explain stuff never missing out any details or functionality is unmatched and quite helpful for beginners like me. Keep Up the Good work mate! :) I'm working on a college project and i'm using your model for the same i was wondering if i could add save as pdf button on clicking view button along side the close button. i know how to add the button as you showed by adding and fading it out on the other menus but how do i link the functions to onclickaction of that button. i'm trying to achieve it by tho but if i could get a bit of help that would be great.
What a wonderful work, Senaid! Your pace and continuity are simply amazing! At first I thought it was scripted with cheat sheets (which is ok), but sir, seeing how you pick your choices and build as you go, that is so impressive. I loved your tutorial and I am using it as a reference for my project. If you don't mind I wanted to ask you for just a guidance, not a ready solution on a plate... What would be your take on reusing this code for managing multiple tables of different size? I would hate to create a duplicate copy for each table, and instead try to reuse its functionality. Do you have any suggestions for me? I just need the approach and general cornerstone ideas. As for the rest I will do my research and find details "how to". Or maybe there is another tutorial that covers how to reuse functions and the recommended "architecture" - what to place where and how to tie everything in together. Something that I could use as inspiration and combine with this tutorial? Thank you sir and much much respect!
Thank you so much! :) Well, it's very hard to explain it in the comment, so I have written in my notes to create a tutorial about that. Basically, what you're looking to do is to create a function (in procedural) or class (in OOP) that will be like a template for what you're going to do in one table. From there that template will basically depending on the inputs generate a different result, but same in design.
Hi Senaid, Great tutorials once again! You are such a kind person for sharing your knowledge with us. I wanted to ask if you can create additional data entries that handle images too? It just handles all text data. Thank you :)
Hi, Senaid. Is it possible to do datatables with postgresql also? I was trying to implement it but I was not able to get the limit query to work and the result I get is "No data available in table"
Senaid thanks for the great video. One question, you are deleting row from the Datatable , so it is not sending Ajax query to the MySql , refreshing and showing "real situation". Let me explain, when you delete table row, you don't have any more 10 entries, but 9, and deleting next one will leave us with 8, this issue will be much more visible if you have striped rows, one white, and underneath one gray, so, if you delete 2nd row, you will have 2 white next to each other, and that doesn't look nice. Any idea, update?
Thank you for the amazing feedback! It's great when viewers asking those questions! In order to fix that problem, in the deleteRow() function, just after I delete the row, you can add the line: $("#tableManager").draw(); This line will "refresh" the data in the table, and on that way fix the problem that you mentioned above.
@@SenaidBacinovic sir i have a poblem when i add or delete some data the ajax is not working it needs to be refresh the page how can i fix that? thank you
Hi Senaid again, it looks like the draw() solution you suggested earlier does not work. Do you have another tip? I am trying to achieve table reload/refresh for both, deleteRow() and manageData() for update and add. Right now Add New will not refresh the table with the new entry. Also, I figured that $("#cat_"+editRowID.val()).html(name.val()); for Edit option is more of a workaround just for the Country field only. DeleteRow() needs the refresh too, because it doesnt update the "Showing 1 to 10 of XXX entries". XXX stays the same and doesn't decrease. I think that a complete reload can help all options: add, edit and delete. Please help!!
Hi Senaid, thanks for the reply. I copied your code over 1:1 and removed all my code that I build on top of your source. This way I excluded all potential issues with versioning and other factors. For example I am loading Bootstrap 4 sources and respective DataTables in my code, but for the sake of experiment I removed everything, only leaving your files. The only alteration was provide root password in ajax.php and add the suggested line as shown below: ========================= function deleteRow(rowID) { if (confirm('Are you sure??')) { $.ajax({ url: 'ajax.php', method: 'POST', dataType: 'text', data: { key: 'deleteRow', rowID: rowID }, success: function (response) { $("#country_"+rowID).parent().remove(); alert(response); } }); $("#tableManager").draw(); } } ========================= I tried moving the line outside $.ajax() and inside, right after and before the alert(), but no luck. The table is not redrawn.
Hi Senaid again, I have an update. I started studying the documentationon DataTables and intuitively tried to use this line of code: $(".table").DataTable().row().remove().draw(); It works but not really. The page is redrawn but it's always the first row that is being deleted from the table, regardless of which one I choose to delete. What are your thought about this method overall? Thanks again!!!!
I am trying to employ this: datatables.net/reference/api/ajax.reload() But failing miserably =((. Th function fails, says It wants an JSON response from server to run. That's as far as I could get but now I am stuck. I like the ajax.reload because it is universal and I am thinking it could be implemented with Add and Update events too.
I got a crud part 1 and crud part 3. Is there a crud part 2? I go to the second video go through the download process and get directed to crud part 1 not part 2.
Hi senaid. I just found a bug recently. I dont know if its only my problem. but whenever i click edit first then I click the add new it retains some info about the edited module. can you help me?
Hmm, have you watched this video till the end? I can't remember the exact time, but somewhere in this video, I will fix that bug(if I remember correctly). :)
yes i did. i have finished it. everything went smoothly but i noticed the bug when i dont hit refresh when I click the add button after hitting edit button. can you help me? Great Tutorial btw. ;)
There's a little bug, at the end of the video, when we remove the parent (row) of country_id it stays in the memory of DataTable (I guess) and when I search on the specific input field, it shows again the row deleted even if we removed it. Same issue when we create a new Country, doesn't update... we have to find out a way to refetch asynchronously all the table rows, any idea? :)
For everyone having the same issue, simply use this in the callback $(".table").DataTable().row($("#country_"+rowID).parent()).remove().draw(); to update the table after deleting the row. Now I'm trying to figure out how to update the table when we create a new country
Dear Sir ,,, the link you share in description,,, whenever i click it will redirect me to your website and from your website whenever i click for download source code it shows me a message to check my email for download source code,,, but when i check my mail i don't find any kind of link,,, please provide me the part 3 tutorial source code or any link to download source code,,,, thank you so much for sharing your knowledge...
It worked! CRUD completed. thank you so much Senaid!
Nice Tutorial Senaid. I was looking for a cleaner, admin section with adding news or whatever... This is the cleanest i ever saw, so far.. THX!!
Awesome, I am so happy that I could help you. Thank you for support!
thank you for this learning video, i feel this video really helped me to understand ajax, jquery, mysql and bootstrap. may God increase your knowledge
Glad to hear that
Thanks! This is very helpful. Hope you make more vid tutorials! So useful for me and the fact that the source code is available is awesome! 👌👌
Awesome, glad I could help. :)
Thankyou for the video, helped me for school.
Glad I could help :)
Senaid You're awesome! The way you proceed , the way you explain stuff never missing out any details or functionality is unmatched and quite helpful for beginners like me. Keep Up the Good work mate! :)
I'm working on a college project and i'm using your model for the same i was wondering if i could add save as pdf button on clicking view button along side the close button. i know how to add the button as you showed by adding and fading it out on the other menus but how do i link the functions to onclickaction of that button. i'm trying to achieve it by tho but if i could get a bit of help that would be great.
What a wonderful work, Senaid! Your pace and continuity are simply amazing! At first I thought it was scripted with cheat sheets (which is ok), but sir, seeing how you pick your choices and build as you go, that is so impressive.
I loved your tutorial and I am using it as a reference for my project. If you don't mind I wanted to ask you for just a guidance, not a ready solution on a plate... What would be your take on reusing this code for managing multiple tables of different size? I would hate to create a duplicate copy for each table, and instead try to reuse its functionality. Do you have any suggestions for me? I just need the approach and general cornerstone ideas. As for the rest I will do my research and find details "how to". Or maybe there is another tutorial that covers how to reuse functions and the recommended "architecture" - what to place where and how to tie everything in together. Something that I could use as inspiration and combine with this tutorial? Thank you sir and much much respect!
Thank you so much! :)
Well, it's very hard to explain it in the comment, so I have written in my notes to create a tutorial about that. Basically, what you're looking to do is to create a function (in procedural) or class (in OOP) that will be like a template for what you're going to do in one table. From there that template will basically depending on the inputs generate a different result, but same in design.
Thank you very much for your helpful video. I have a question like that: "How can the table always show 10 rows when i deleted one of them?".
Hi Senaid, Great tutorials once again! You are such a kind person for sharing your knowledge with us. I wanted to ask if you can create additional data entries that handle images too? It just handles all text data. Thank you :)
Yes, for sure, I will think about the tutorial that will covert that too. :)
Cant wait! Thanks, Senaid ;)
Hi, Senaid. Is it possible to do datatables with postgresql also? I was trying to implement it but I was not able to get the limit query to work and the result I get is "No data available in table"
Senaid thanks for the great video. One question, you are deleting row from the Datatable , so it is not sending Ajax query to the MySql , refreshing and showing "real situation". Let me explain, when you delete table row, you don't have any more 10 entries, but 9, and deleting next one will leave us with 8, this issue will be much more visible if you have striped rows, one white, and underneath one gray, so, if you delete 2nd row, you will have 2 white next to each other, and that doesn't look nice. Any idea, update?
Thank you for the amazing feedback! It's great when viewers asking those questions! In order to fix that problem, in the deleteRow() function, just after I delete the row, you can add the line:
$("#tableManager").draw();
This line will "refresh" the data in the table, and on that way fix the problem that you mentioned above.
sir thank you so much you've really help me with my project in school thank you .
Glad I could help!
@@SenaidBacinovic sir i have a poblem when i add or delete some data the ajax is not working it needs to be refresh the page how can i fix that?
thank you
Really amazing something i have been for a while now. Thanks man :)
Awesome, glad I could help! :)
Great tutorial thankyou very much
Hi Senaid again, it looks like the draw() solution you suggested earlier does not work. Do you have another tip? I am trying to achieve table reload/refresh for both, deleteRow() and manageData() for update and add.
Right now Add New will not refresh the table with the new entry. Also, I figured that $("#cat_"+editRowID.val()).html(name.val()); for Edit option is more of a workaround just for the Country field only.
DeleteRow() needs the refresh too, because it doesnt update the "Showing 1 to 10 of XXX entries". XXX stays the same and doesn't decrease. I think that a complete reload can help all options: add, edit and delete.
Please help!!
It should work. Can you show me the code?
Hi Senaid, thanks for the reply. I copied your code over 1:1 and removed all my code that I build on top of your source. This way I excluded all potential issues with versioning and other factors. For example I am loading Bootstrap 4 sources and respective DataTables in my code, but for the sake of experiment I removed everything, only leaving your files. The only alteration was provide root password in ajax.php and add the suggested line as shown below:
=========================
function deleteRow(rowID) {
if (confirm('Are you sure??')) {
$.ajax({
url: 'ajax.php',
method: 'POST',
dataType: 'text',
data: {
key: 'deleteRow',
rowID: rowID
}, success: function (response) {
$("#country_"+rowID).parent().remove();
alert(response);
}
});
$("#tableManager").draw();
}
}
=========================
I tried moving the line outside $.ajax() and inside, right after and before the alert(), but no luck. The table is not redrawn.
Hi Senaid again, I have an update. I started studying the documentationon DataTables and intuitively tried to use this line of code:
$(".table").DataTable().row().remove().draw();
It works but not really. The page is redrawn but it's always the first row that is being deleted from the table, regardless of which one I choose to delete.
What are your thought about this method overall?
Thanks again!!!!
I am trying to employ this: datatables.net/reference/api/ajax.reload()
But failing miserably =((. Th function fails, says It wants an JSON response from server to run. That's as far as I could get but now I am stuck. I like the ajax.reload because it is universal and I am thinking it could be implemented with Add and Update events too.
Any news?
Another good video.
Thumbs up!
Rohan Saand thank you :)
I got a crud part 1 and crud part 3. Is there a crud part 2? I go to the second video go through the download process and get directed to crud part 1 not part 2.
how to add category search also
when i am trying to add new record model title is showing name of country from previous record. How i can make it correct?
i used your code in my project.it's working fine. but it not show search option and pagination.how can i fix this error? can you help me?
So amazing
Many thanks man
thank you :)
Thank you so much sir.
How to reload datatable after success: function() without using window.location.reload()?
Hi i just want to ask why is my new append row table disappearing whenever i click the desc asc function of datatable? how do i prevent it?
Here is a nice example of how you can achieve it: datatables.net/examples/api/add_row.html
If you don't understand something, let me know. :)
thanks sir!! just found that you can't add id on td in this method of add row..
When I add the delete function, add new function does not work. How can I solve this ?
Hi senaid. I just found a bug recently. I dont know if its only my problem. but whenever i click edit first then I click the add new it retains some info about the edited module. can you help me?
Hmm, have you watched this video till the end? I can't remember the exact time, but somewhere in this video, I will fix that bug(if I remember correctly). :)
yes i did. i have finished it. everything went smoothly but i noticed the bug when i dont hit refresh when I click the add button after hitting edit button. can you help me? Great Tutorial btw. ;)
I just fixed it.. i kinda missed something in the video. Thanks for the help!!!!
Amazing, glad you made it! :)
I am not able to catch the solution, please explain
When i'm adding nes record it doesn't add to the data table. What is the problem?
Excelent Series... Thanks...
thank you :)
There's a little bug, at the end of the video, when we remove the parent (row) of country_id it stays in the memory of DataTable (I guess) and when I search on the specific input field, it shows again the row deleted even if we removed it. Same issue when we create a new Country, doesn't update... we have to find out a way to refetch asynchronously all the table rows, any idea? :)
For everyone having the same issue, simply use this in the callback $(".table").DataTable().row($("#country_"+rowID).parent()).remove().draw(); to update the table after deleting the row. Now I'm trying to figure out how to update the table when we create a new country
thank you so mcuch for help dear sir
Awesome, I am so happy that I could help you. Thank you for support!
ur always welcome dear you are great
Shout out to you buddy.! your tutorial awesome. Pls, let me know if you have other complete series of programming course in "udemy.com".
Thank you Sebastian. I don't have on udemy, but I have it here: www.cpicoach.com/accelerator :)
hi, excelent but how we can add an excel export button. thanks
Alejandro Pereira I will record a tutorial to show you how to do it.
Coding Passive Income really. When? I will apreciated. Thanks
Alejandro Pereira probably in the next few days
Coding Passive Income perfect. Thanks
Hi, when I open your code on the web the code keeps adding new IDs:'.$data["id"]. and country names: .$data["countryName"].'. Any help ?
Hmm, I am not sure what is the problem. Can you show me the picture?
Hello, i've been having the same issue. Were you able to resolve it? How? Thanks
need a site. Interested?
Hey James, please use my contact form and we can go from there: codingpassiveincome.com/contact
Where is the source code? The link above just brings me to your website.
Yes, and once you're there at the right side there is blue button "Download Source Code" :)
Found it! Had to disable adblocker :) Thank you sir!
Amazing, glad you made it! :)
download link not working. thumb down :|
Hmm, are you sure? I have just tested and it does work without any problem. What exactly is happening on your side?
Coding Passive Income clicking ..... Nothing happens....
Have you received any message from CodingPassiveIncome to your Facebook messenger?
Sorry, I don't get any link for downloading source code from you, please correct it sir.
•Reply•Share ›
Can you reply to that email?
Dear Sir ,,, the link you share in description,,, whenever i click it will redirect me to your website and from your website whenever i click for download source code it shows me a message to check my email for download source code,,, but when i check my mail i don't find any kind of link,,, please provide me the part 3 tutorial source code or any link to download source code,,,, thank you so much for sharing your knowledge...
Thank you so much... Finaly i got it.
Awesome :D
no email link download send to me
Have you got an email? If you did, please just reply to that email and I will send you a download link.
I have not received an email yet. this is my email fahri.halid@gmail.com thanks before
I have just sent you a download link for entire CRUD system. :)
Brother please give you skype pr facebook