Jump to content
MakeWebGames

Recommended Posts

Posted

Ive made a small script to plan my projects all it is is basically one large list but the list can have unlimited "parents"/"children" even the "children" can have "children" etc etc there is no limit (other then your db. :p) I'll get print screens tomorrow and if people like it I'll release if for free as it only took me a hour or so to code :)

If you would like me to explain it in a bit more detail just ask.

  • test
  • test
    • test
    • test
      • test
      • test
      • test
        • test
        • test
        • test
        • test

        [*]test

      [*]test

      [*]test

    [*]test

    [*]test

    • test
    • test
    • test
    • test

Pretty much like that but Obv not the same CSS

  • Like 1
Posted

I would be interested in a tool of this sort. Would definitely make use of it. Many free popular project management tool on the net aren't good enough in my opinion. Keep us posted with the development of this. I'd be happy to contribute some work towards it also and use it sometime in the immediate future.

Posted

I've just got to optimise it a little as ATM it searches for children for every <li> and if you have a few 100 like I'm gona have it will get slow so I'm going to only search for children if it has children so in the example above thee would only be 5 querys other then 20

Posted

Glad you like the idea :)

Also just to let people know I've used the JQuery UI for the styling no reason other then I wanted to see what it looked like and to make it easier/more efficient adding data (I've codeded it so when you add a child it only re-loads the parent and not the whole tree.

I'm going to change a few more things tonight add a few ideas given to me/some I've thought of so it will help you/me plan projects better

Posted
Glad you like the idea :)

Also just to let people know I've used the JQuery UI for the styling no reason other then I wanted to see what it looked like and to make it easier/more efficient adding data (I've codeded it so when you add a child it only re-loads the parent and not the whole tree.

I'm going to change a few more things tonight add a few ideas given to me/some I've thought of so it will help you/me plan projects better

Just as an FYI, it would be cool to have links as methods.

I.e.:

var parent = {
   one: 'some value',
   'do stuff': function() {
       // do stuff
       },
    three: 1
}

$.each(parent, function(k, v) {
   if (typeof(v) == 'function') {
       element = $('<span>' + k + '</span>')
       $(body).append(element)
       element.onclick(v)
  } elseif(typeof(v) == 'object')
       $(body).append(v)
  else
       $(body).append('<span id="' + k + '">' + v + '</span>') 
}

 

Not tested, but would be pretty damn cool.

Posted

atm the list is generated like this via php

function child($parent) {
	$parent = abs(intval($parent));
	$query = mysql_query("SELECT * FROM `child` WHERE `parent`=$parent");
	$return = '';
	while ($child = mysql_fetch_array($query)) {
		if ($child['children']) {
			$return = $return.'<li id="'.$child['id'].'">'.$child['text'].'<small style="display:none;">   <span class="add_link" cid="'.$child['id'].'" onclick="add()">[+]</span> <span class="remove_link" cid="'.$child['id'].'">[-]</span></small></li>'.child($child['id']);
		} else {
			$return = $return.'<li id="'.$child['id'].'">'.$child['text'].'<small style="display:none;">   <span class="add_link" cid="'.$child['id'].'" onclick="add()">[+]</span> <span class="remove_link" cid="'.$child['id'].'">[-]</span></small></li>';
		}
	}
	return '<ul class="'.$parent.'">'.$return.'</ul>';
}

but ill look into doing it as you said

Posted
atm the list is generated like this via php
   function child($parent) {
       $parent = abs(intval($parent));
       $query = mysql_query("SELECT * FROM `child` WHERE `parent`=$parent");
       $return = '';
       while ($child = mysql_fetch_array($query)) {
           if ($child['children']) {
               $return = $return.'<li id="'.$child['id'].'">'.$child['text'].'<small style="display:none;">   <span class="add_link" cid="'.$child['id'].'" onclick="add()">[+]</span> <span class="remove_link" cid="'.$child['id'].'">[-]</span></small></li>'.child($child['id']);
           } else {
               $return = $return.'<li id="'.$child['id'].'">'.$child['text'].'<small style="display:none;">   <span class="add_link" cid="'.$child['id'].'" onclick="add()">[+]</span> <span class="remove_link" cid="'.$child['id'].'">[-]</span></small></li>';
           }
       }
       return '<ul class="'.$parent.'">'.$return.'</ul>';
   }

 

but ill look into doing it as you said

You could pass an associative array as JSON to the page, and render it.

It would appear as a list item, but eval() or a external Javascript event hook can always be added after the initial population.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...