Bootstrap Modal (View, Edit, Delete) |
I'm trying to add the basic CRUD function to models in bootstrap. Adding them in a foreach loop with primary key as ID's for models creates a loot of models and this is very bad practice. Is there a way to create only one model for each CRUD functions and send the data to it somehow ?
Any help is good. Thanks for your time.
Website : www.my-web-projects.com
You can create a MY_Model and extend all your models from MY_Model
See the CI Users Guide on MY_Model What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(12-15-2014, 05:42 AM)InsiteFX Wrote: You can create a MY_Model and extend all your models from MY_Model I know that I have did it for my CI models .. this is not that much related to CI but i posted here to in the hope someone did this before.. When i say model i was referring to bootstrap models ....
Website : www.my-web-projects.com
(12-15-2014, 06:00 AM)GrigoreMihai Wrote:(12-15-2014, 05:42 AM)InsiteFX Wrote: You can create a MY_Model and extend all your models from MY_Model I believe you are asking regarding http://getbootstrap.com/javascript/#modals ? My method to do this with as few lines of code is the following:
Here is a example code Code: $('.item-edit').on("click", function() { For my data, I tend to put it in a span tag with data attributes but you can store the information in other places.
(12-15-2014, 09:55 AM)advoor Wrote:(12-15-2014, 06:00 AM)GrigoreMihai Wrote:(12-15-2014, 05:42 AM)InsiteFX Wrote: You can create a MY_Model and extend all your models from MY_Model Will try it .. thanks for the info.
Website : www.my-web-projects.com
|
Welcome Guest, Not a member yet? Register Sign In |