Welcome Guest, Not a member yet? Register   Sign In
a few tough questions...
#1

[eluser]jblack199[/eluser]
Okay I'm going to ask all the questions I have in this one spot, specifically so they are all combined in one easy location and if you answer one or all then awesome!

1. jQuery drag and drop: I can get drag and drop to work fine. But what I'm doing (want to do) is for my CMS admin to create the front-end top navigation I want to have 2 lists (in div's probably). First list is 'available pages' and the second list is 'navigation' or something like that.. but what I need to be able to do is drag from one container to the other container and have it lock in place while updating say a hidden form field with the id number of the page so that when the user hits 'save' it's saved..

2. In my admin I have a nav called 'plugins', so what I want to do is have the script read from a directory all the plugins installed into the program itself. Now this would normally be empty but it has got to be in a way that each plugin can have its own models, views and controllers for both the front-end and the admin without causing users to constantly need to change a ton of stuff around in the CMS code to get it to work. I'm thinking like plug and play type plugins.. So odds are i'm guessing that I'd need to read a directory and obtain all the folder names and figure out how to give each plugin the ability to have its own models, views and controllers...

Question 2 would also pertain to themes as well, but if I get help with plugins I can figure out the themes portion. If anyone knows, tries out, or helps in any way I appreciate it and thank you.
#2

[eluser]jblack199[/eluser]
So I figured out how to do the drag drop with jquery. The real way to do what I want to do is with the sortable plugin for jquery.

I would first have my CSS
Code:
#leftColumn {
    border:1px solid #ccc;
    float:left;
    margin-right:5%;
    padding:5px;
    width:40%;
}

#rightColumn {
    border:1px solid #ccc;
    float:right;
    padding:5px;
    width:40%;
}

ul {
    min-height:50px;
    /*IE doesn't understand min-height, but this will fix that*/
    height:auto !important;
     height:50px;
}

li {
    cursor:move;
}

I would then do my JS code
Code:
$(document).ready({
  $("#listB").sortable({
    connectWith: ['#listA'],
    receive: function(event, ui) {
       //Run this code whenever an item is dragged and dropped into this list
       var itemText= ui.item.text();
       alert(itemText + " just joined this list");

     },
    remove: function(event, ui){
       //Run this code whenever an item is dragged and dropped out of this list
       var itemText= ui.item.text();
       alert(itemText + " just left this list");    
    }
  });
});

and viola it works... Now downside to this, is it is supposed to NOT work in IE7 or before. That could be a problem if anyone who gets their hands on my software still uses IE7 as a primary browser.

Next trick on that part, is going to figure out how to not check the text per-say, but to check the ID number that goes along with that text. either way, that should be a good way to handle creation of my main header navigation as well as my sub-navigation (if any) allowing for a pretty good effect in the end for user control...

Question 2 is still outstanding though, that one I dont know enough about CI to figure out.




Theme © iAndrew 2016 - Forum software by © MyBB