[Proto-Scripty] Updating List - Issue with implementation
Hi guys, I am using scriptaculous to create a draggable sortable list using AJAX and PHP. I had this working fine with adding, deleting and sorting before changing the input to use 2 text area's for input. I used to have the following code: function process(content, action) { if (action == "recreateList") { params = "?content=" + serialise(content)+ "&chunkContent=" + null + "&action=recreateList"; } } but I have taken out the content from the process so I can control more than one text box but can work out what needs to go into the: serialise(content) instead of the content in order to allow me to reorder the list. I can do it visually but when I refresh then it returns to the original order. (I fixed the delete issue simply by creating a global variable and passing that through and I think I need to do the same for this but dont know what the variable would be) ANY help would be greatly appreciated, I think the rest of my code for dealing with placing it into the database etc is correct as it worked before so im fairly confident its just this line. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Creating other lists from a drag and drop list
Hi all, I have a sortables list (using script.aculo.us, php and ajax) which is created from user input containing a title and description field. What I want to be able to do is use that list to select an element of the list (list A) and be able to click a button (dragging would be great but dont know if its possible) to be able to put it into another sortable list (list B) as a linked object (so any changes made to the original would be proplegated). Is this possible? If so how would I go about it / get started? I would also like to be able to make List B dependant on which option of List C (a list of options) was selected. Again, is this possible? How would I go about implementing this? Many Thanks for your time. Can provide any code needed or further explanations here or am happy to receive email. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Updating List - Issue with implementation
Thanks for the help firstly :) It does clarify, I know that "chunksList" needs to go in serialise (content) - I think, just not sure how to access that in the script. Here is the parts of the code, its possible I have made an error: from the script: function startup() { Sortable.create("chunksList", {tag:"li"}); } function serialise(listID) { var length = document.getElementById(listID).childNodes.length; var serialised = ""; for (i = 0; i < length; i++) { var li = document.getElementById(listID).childNodes[i]; var id = li.getAttribute("id"); // add number to serialised array serialised += encodeURIComponent(id) + "_"; } // returns array (with last "_" removed return serialised.substring(0, serialised.length - 1); } --- and also the original code fragment. then from chunkslist.class.php - chunks are the items of data going into the list case 'recreateList': $reOrder = explode('_', $content); for ($i=0; $i < count($reOrder); $i++) { $new_order[$i] = $this->mysqlConnection->real_escape_string($reOrder [$i]); $result = $this->mysqlConnection->query('UPDATE chunks SET order_no="' . $i . '" WHERE id="' . $reOrder[$i] . '"'); } $recreatedList = $this->BuildChunksList(); return $recreatedList; break; Thanks again for taking the time On Feb 23, 12:58 pm, Walter Lee Davis wrote: > content.serialize() could be re-written as "variable you set to the > return of Sortable.create".serialize(); > > var foo = Sortable.create('somDomElement',{}); > > ... > > var sortOrder = foo.serialize(); > > Does that help? > > Walter > > On Feb 23, 2009, at 7:00 AM, vanq69 wrote: > > > > > ANY help would be greatly appreciated, I think the rest of my code for > > dealing with placing it into the database etc is correct as it worked > > before so im fairly confident its just this line. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Updating List - Issue with implementation
Thanks again for your help. I have spent the last hour reading through the documentation and working through the example and also your notes. I believe I am getting closer, but I did not understand how your: //php foreach($_POST['order'] as $k=>$v){ if($item = ActiveRecord::FindById('items',$v){ $v->position = $k+1; $v->save(); would be implemented. I have a code file which my AJAX requests are passed through, which contains the code: Process($chunkTitle, $chunkContent, $order, $action); ?> in this "$order = $_GET['order'] is the line i have added to handle the following call: if (action == "recreateList") { params = "?chunkTitle=" + null + "&chunkContent=" + null + "&order=" + fooOrder + "&action=recreateList"; } the other parts of the javascript file are as you recommended and I think are working. So it comes down to the chunkslist.class.php file, I have looked at the database as I am trying different options and its not changing at all, either good or bad (ie corrupting) with the following code: public function Process($chunkTitle, $chunkContent, $chunksList, $action) { switch($action) { case 'recreateList': $newOrder = explode('_', $order); for ($i=0; $i < count($newOrder); $i++) { $newOrder[$i] = $this->mysqlConnection->real_escape_string ($newOrder[$i]); $result = $this->mysqlConnection->query('UPDATE chunks SET order_no="' . $i . '" WHERE id="' . $newOrder[$i] . '"'); } $recreatedList = $this->BuildChunksList(); return $recreatedList; break; I have tried several different versions of this, the one you see is the one that worked previously before I added the other text, it is also very similar to the tutorial. Any further help would be greatly appreciated, I can email the files if its easier to see that way and you have the time. Regards On Feb 23, 1:55 pm, Walter Lee Davis wrote: > sorry, this part should have been > > var foo = Sortable.create('chunksList',{}) //no need to tell it > tag:li -- it's the default > > Walter > > On Feb 23, 2009, at 8:33 AM, Walter Lee Davis wrote: > > > var foo = Sortable.serialize('chunksList',{}) //no need to tell it > > tag:li -- it's the default --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Updating List - Issue with implementation
Thanks yet again for you taking the time to assist me, this is proving to be most frustrating for me (and for yourself I imagine!) as I just cant seem to get this working :( Im going to (hopefully) lay out the code step by step, and perhaps if you have the time then you can tell me where im wrong - ill understand if you dont of course and thanks for the time spent helping so far. Creation of sortable list: function startup() { Sortable.create("chunksList", {}); Droppables.add("trash", { onDrop: function(element) { var deleteChunk = confirm("Are you sure you want to delete this Chunk?") if (deleteChunk) { Element.hide(element); delElement = element.id; process("delChunk"); } } }); } -- Sending the server request: function process(action) { var getdate = new Date(); //Used to prevent caching during ajax call if (xmlHttp) // Checks xmlHttp is valid { params = ""; if (action == "recreateList") { params = "?chunkTitle=" + null + "&chunkContent=" + null + "&order=" + {order:Sortable.serialize("chunksList")} + "&action=recreateList"; } else if (action == "addNewChunk") { var chunkTitle = document.getElementById("txtChunkTitle"); var chunkContent = document.getElementById("txtChunkContent"); if (chunkTitle.value && chunkContent.value) // makes sure Chunk isnt null params = "?chunkTitle=" + chunkTitle.value + "&chunkContent=" + chunkContent.value + "&chunksList=" + null + "&action=addNewChunk"; } else if (action =="delChunk") { params = "?chunkTitle=" + delElement + "&chunkContent=" + null + "&chunksList=" + null + "&action=delChunk"; } if (params) cache.push(params); // checks params isnt null then adds to cache for sending try // try connecting to server { // check cache is not empty and connection is available if ((xmlHttp.readyState == 4 || xmlHttp.readyState == 0) && cache.length>0) { var cacheEntry = cache.shift(); // initiate the request xmlHttp.open("GET", "dndChunkList.php" + cacheEntry, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form- urlencoded"); xmlHttp.onreadystatechange = executeStateChange; xmlHttp.send(null); } else { setTimeout("process();", 1000); } } catch (e) { displayError(e.toString()); } } } // function that retrieves the HTTP response function executeStateChange() { if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200) { chunkUpdate(); } else { displayError(xmlHttp.statusText); } } } // Processes server's response function chunkUpdate() { var response = xmlHttp.responseText; document.getElementById("chunksList").innerHTML = response; document.getElementById("txtChunkTitle").value = ""; document.getElementById("txtChunkContent").value = ""; } -- dndChunkList.php Process($chunkTitle, $chunkContent, $order, $action); ?> -- And finally the chunkslist.class.php public function Process($chunkTitle, $chunkContent, $order, $action) { switch($action) { case 'recreateList': $newOrder = $_GET['order']; for ($i=0; $i < count($newOrder); $i
[Proto-Scripty] Re: Updating List - Issue with implementation
Many thanks for your help, this is all working now. On Feb 23, 7:55 pm, Walter Lee Davis wrote: > You know, I think this really should be > > + Sortable.serialize("chunksList",{name:'order'}) + > > Sortable.serialize already puts the key/value pair together for you. > > Walter > > On Feb 23, 2009, at 2:47 PM, Walter Lee Davis wrote: > > > "&order=" + Sortable.serialize("chunksList") + --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Adding Scroll bars to list
I have a sortable draggable list with a droppable delete box, each entry in the list has a single text line. My question is this, how do I determine that when the list reaches a certain size that I want it to use scroll bars to avoid disrupting the rest of the page layout, whilst keeping the delete box in the same place if possible (ie at the bottom, i dont want it to be part of the scrolling) This is the current code I use to build the list: function startup() { Sortable.create("chunksList", {}); Droppables.add("trash", { onDrop: function(element) { var deleteChunk = confirm("Are you sure you want to delete this Chunk?") if (deleteChunk) { Element.hide(element); process(element.id, "delChunk"); } } }); } Many thanks for taking the time to read. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Creating other lists from a drag and drop list
Thanks David, think this was roughly around how I was planning to develop but wanted to check more it wasnt impossible before beginning :) Will repost when I have tried if I have problems. On Feb 24, 11:09 am, david wrote: > Hi vanq69, > > the sortable list could be linked to droppables. So you could be able > to use this to drag from listA to listB. > The link between the 2 elements in listA et listB could only be > maintain externally from prototype and scriptaculous. But on using > callback from sortable / droppables I think you can do that. > > btw, I think you should try to write what you want to do and we could > help if problems occurs on what you write. > > -- > david > > On 23 fév, 13:51, vanq69 wrote: > > > Hi all, > > > I have a sortables list (using script.aculo.us, php and ajax) which is > > created from user input containing a title and description field. > > > What I want to be able to do is use that list to select an element of > > the list (list A) and be able to click a button (dragging would be > > great but dont know if its possible) to be able to put it into another > > sortable list (list B) as a linked object (so any changes made to the > > original would be proplegated). Is this possible? If so how would I > > go about it / get started? > > > I would also like to be able to make List B dependant on which option > > of List C (a list of options) was selected. Again, is this possible? > > How would I go about implementing this? > > > Many Thanks for your time. Can provide any code needed or further > > explanations here or am happy to receive email. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Adding Scroll bars to list
Thanks David, gives me a couple of options, Im not worried about the list being of a fixed dimension even when empty that is fine, its more it extending too far so I think having a go at option 1 is the best bet for me. Will have a try and post with any issues. Thanks On Feb 24, 11:27 am, david wrote: > Hi vanq69, > > one simple method to do this is to force the global size of the ul > element of the list to a fixed dimension, but in that case, for small > list, the element still extend to its defined dimension. > > Another (preferred way) could be to have a callback on the creation of > the list to test dimensions and apply preferred dimensions if it's too > big. > the callback could be set on the sortable creation. > > The main problem with general question like the one you ask is that > you could have numerous way to do that, but depending to your code, > context or design, some restriction could appear. > As for your previous question, just post the global HTML page, and try > doing it, if you can'ty do what you want, then post the problem, it's > definitelly easier to modify exting code ... and if you're wrong in > doing something, it's easier for us to point the problem. > > -- > david > > On 24 fév, 06:32, vanq69 wrote: > > > I have a sortable draggable list with a droppable delete box, each > > entry in the list has a single text line. > > > My question is this, how do I determine that when the list reaches a > > certain size that I want it to use scroll bars to avoid disrupting the > > rest of the page layout, whilst keeping the delete box in the same > > place if possible (ie at the bottom, i dont want it to be part of the > > scrolling) > > > This is the current code I use to build the list: > > > function startup() > > { > > Sortable.create("chunksList", {}); > > > Droppables.add("trash", > > { > > onDrop: function(element) > > { > > var deleteChunk = confirm("Are you sure you want to > > delete this > > Chunk?") > > if (deleteChunk) > > { > > Element.hide(element); > > process(element.id, "delChunk"); > > } > > } > > }); > > > } > > > Many thanks for taking the time to read. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Adding Scroll bars to list
Have had a look into this and havent been able to find a suitable method. I am aiming for having a space for 12 rows with scrollbars to get to the rest, with the top div - "addPage" and the bottom div - "trash" being always visible. Here is the code im currently trying: Chunk List DRAG HERE TO ADD TO PAGE BuildChunksList(); ?> DRAG HERE TO DELETE And here is the relevant parts of the CSS: /* Sidebar2 CSS */ #sidebar2 { float: centre; padding: 20px 20px; } #addPage { border: 4px solid #ffd90f; width: 190px; padding: 10px; } ul.sortableList { list-style-type: none; padding: 0px; margin: 0px; width: 220px; } ul.sortableList li { cursor: move; padding: 2px 2px; margin: 2px 0px; border: 1px solid #ffd90f; background-color: #eee; } #trash { border: 4px solid #ffd90f; width: 190px; padding: 10px; } Any thoughts or help would be great :) Regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Adding Scroll bars to list
Thanks for the CSS tip, im certainly not an expert with it at this stage so what I have is simply a rough mock up to give me some structure whilst I am doing the coding. RE Javascript I have all the javascript working for the sortable list and related ajax and php elements, its simply the creating of scroll bars for the list im unsure of how to do - would this need to be in javascript?? /// /// /// ///Droppable 1/// /// Fixed /// /// /// /// /// /// /// ///Sortable /// /// List /// /// /// ///Scrollable /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///Droppable 2/// /// Fixed /// /// /// /// This is the design format I have at the moment but without the middle bit being scrollable - this is what I am unsure of how to do. Hope this clears things up, thanks for the help so far :) On Feb 26, 1:18 pm, "Alex Mcauley" wrote: > Firstly in your CSS you have float:centre > > There is no float:center as far as i know .. if there were it would be > "center" <--- american spelling > > i also cannot see any Javascript in there to help you with > > - Original Message - > From: "vanq69" > To: "Prototype & script.aculo.us" > Sent: Thursday, February 26, 2009 11:37 AM > Subject: [Proto-Scripty] Re: Adding Scroll bars to list > > > Have had a look into this and havent been able to find a suitable > > method. > > > I am aiming for having a space for 12 rows with scrollbars to get to > > the rest, > > with the top div - "addPage" and the bottom div - "trash" being always > > visible. > > > Here is the code im currently trying: > > > > > > > > > > > Chunk List > > > > DRAG HERE TO ADD TO PAGE > > > > > > > onmouseup="processChunk('chunksList', 'recreateList')"> > > > $myChunksList = new ChunksList(); > > echo $myChunksList->BuildChunksList(); > > ?> > > > > > > > > DRAG HERE TO DELETE > > > > > > > > > > > And here is the relevant parts of the CSS: > > > /* Sidebar2 CSS */ > > > #sidebar2 { > > float: centre; > > padding: 20px 20px; > > } > > > #addPage > > { > > border: 4px solid #ffd90f; > > width: 190px; > > padding: 10px; > > } > > > ul.sortableList > > { > > list-style-type: none; > > padding: 0px; > > margin: 0px; > > width: 220px; > > } > > > ul.sortableList li > > { > > cursor: move; > > padding: 2px 2px; > > margin: 2px 0px; > > border: 1px solid #ffd90f; > > background-color: #eee; > > } > > > #trash > > { > > border: 4px solid #ffd90f; > > width: 190px; > > padding: 10px; > > } > > > Any thoughts or help would be great :) > > > Regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Adding Scroll bars to list
Thanks for the CSS tip, im certainly not an expert with it at this stage so what I have is simply a rough mock up to give me some structure whilst I am doing the coding. RE Javascript I have all the javascript working for the sortable list and related ajax and php elements, its simply the creating of scroll bars for the list im unsure of how to do - would this need to be in javascript?? /// /// /// ///Droppable 1/// /// Fixed /// /// /// /// /// /// /// ///Sortable /// /// List /// /// /// ///Scrollable /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///Droppable 2/// /// Fixed /// /// /// /// This is the design format I have at the moment but without the middle bit being scrollable - this is what I am unsure of how to do. Hope this clears things up, thanks for the help so far :) On Feb 26, 1:18 pm, "Alex Mcauley" wrote: > Firstly in your CSS you have float:centre > > There is no float:center as far as i know .. if there were it would be > "center" <--- american spelling > > i also cannot see any Javascript in there to help you with > > - Original Message - > From: "vanq69" > To: "Prototype & script.aculo.us" > Sent: Thursday, February 26, 2009 11:37 AM > Subject: [Proto-Scripty] Re: Adding Scroll bars to list > > > Have had a look into this and havent been able to find a suitable > > method. > > > I am aiming for having a space for 12 rows with scrollbars to get to > > the rest, > > with the top div - "addPage" and the bottom div - "trash" being always > > visible. > > > Here is the code im currently trying: > > > > > > > > > > > Chunk List > > > > DRAG HERE TO ADD TO PAGE > > > > > > > onmouseup="processChunk('chunksList', 'recreateList')"> > > > $myChunksList = new ChunksList(); > > echo $myChunksList->BuildChunksList(); > > ?> > > > > > > > > DRAG HERE TO DELETE > > > > > > > > > > > And here is the relevant parts of the CSS: > > > /* Sidebar2 CSS */ > > > #sidebar2 { > > float: centre; > > padding: 20px 20px; > > } > > > #addPage > > { > > border: 4px solid #ffd90f; > > width: 190px; > > padding: 10px; > > } > > > ul.sortableList > > { > > list-style-type: none; > > padding: 0px; > > margin: 0px; > > width: 220px; > > } > > > ul.sortableList li > > { > > cursor: move; > > padding: 2px 2px; > > margin: 2px 0px; > > border: 1px solid #ffd90f; > > background-color: #eee; > > } > > > #trash > > { > > border: 4px solid #ffd90f; > > width: 190px; > > padding: 10px; > > } > > > Any thoughts or help would be great :) > > > Regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Adding Scroll bars to list
That was exactly what I meant, thank you very much! This works well for the scrolling, however it doesnt allow me to "see" the drop into the droppables now. I can make them if the mouse is over and it works but doesnt show the droppable over the box anymore, im guessing there is little I can do about this? If so then its not a major issue and the scrolling is much more useful but would be nice to be able to have both. (if i move the div to include the droppable box's then they simply scroll with them which isnt what I need) Thanks for your help so far :) On Feb 26, 3:56 pm, "Alex Mcauley" wrote: > I'm still not sure what you mean by scrollable > > If you mean scroll bars in an element you can achieve it like this > > > Some Content that exceeds 100px by 100px will add automatic scrollbars to > the element > > > > - Original Message - > From: "vanq69" > To: "Prototype & script.aculo.us" > Sent: Thursday, February 26, 2009 3:49 PM > Subject: [Proto-Scripty] Re: Adding Scroll bars to list > > Thanks for the CSS tip, im certainly not an expert with it at this > stage so what I have is > simply a rough mock up to give me some structure whilst I am doing the > coding. > > RE Javascript I have all the javascript working for the sortable list > and related ajax and > php elements, its simply the creating of scroll bars for the list im > unsure of how to do - > would this need to be in javascript?? > > /// > /// /// > /// Droppable 1 /// > /// Fixed /// > /// /// > /// > > /// > /// /// > /// Sortable /// > /// List /// > /// /// > /// Scrollable /// > /// /// > /// /// > /// /// > /// /// > /// /// > /// > > /// > /// /// > /// Droppable 2 /// > /// Fixed /// > /// /// > /// > > This is the design format I have at the moment but without the middle > bit being scrollable - this is what > I am unsure of how to do. > > Hope this clears things up, thanks for the help so far :) > > On Feb 26, 1:18 pm, "Alex Mcauley" > wrote: > > Firstly in your CSS you have float:centre > > > There is no float:center as far as i know .. if there were it would be > > "center" <--- american spelling > > > i also cannot see any Javascript in there to help you with > > > - Original Message - > > From: "vanq69" > > To: "Prototype & script.aculo.us" > > > > Sent: Thursday, February 26, 2009 11:37 AM > > Subject: [Proto-Scripty] Re: Adding Scroll bars to list > > > > Have had a look into this and havent been able to find a suitable > > > method. > > > > I am aiming for having a space for 12 rows with scrollbars to get to > > > the rest, > > > with the top div - "addPage" and the bottom div - "trash" being always > > > visible. > > > > Here is the code im currently trying: > > > > > > > > > > > > > > > > Chunk List > > > > > > DRAG HERE TO ADD TO PAGE > > > > > > > > > > > onmouseup="processChunk('chunksList', 'recreateList')"> > > > > > $myChunksList = new ChunksList(); > > > echo $myChunksList->BuildChunksList(); > > > ?> > > > > > > > > > > > > DRAG HERE TO DELETE > > > > > > > > > > > > > > > > And here is the r
[Proto-Scripty] Re: Adding Scroll bars to list
New code: Chunk List DRAG HERE TO ADD TO PAGE BuildChunksList(); ?> DRAG HERE TO DELETE --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Adding Value to List Bug
Hi all, I hope you can help. I have a bug when adding a value to my sortable list - it all works fine when data is present in the 2 text boxes, my issue is when there is no data. When the 2 text boxes are empty and I press the button to submit nothing happens UNTIL I enter any value into the boxes, as soon as both boxes have a character then it adds it to the list automatically. Obviously I want to not add blank data but also if the user presses add without data then the add "reset" so the user has to press it again before any data can be added. - Here is the relevant code I believe: HTML Index Page - Form: Create New Chunk Chunk Name Chunk Description JavaScript: function insertChunk() { if (xmlHttp) { params = ""; var chunkTitle= trim(encodeURIComponent(document.getElementById ('txtChunkTitle').value)); var chunkContent = trim(encodeURIComponent(document.getElementById ('txtChunkContent').value)); if (chunkTitle && chunkContent) // makes sure Chunk isnt null { params = "?chunkTitle=" + chunkTitle + "&chunkContent=" + chunkContent; } if (params) cache.push(params); try { // only continue if the connection is clear and cache is not empty if ((xmlHttp.readyState == 4 || xmlHttp.readyState == 0) && cache.length>0) { // get next set of values from cache var cacheEntry = cache.shift(); xmlHttp.open("GET", "addChunkList.php" + cacheEntry, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www- form-urlencoded"); xmlHttp.onreadystatechange = executeChunkStateChange; xmlHttp.send(null); } else { setTimeout("insertChunk();", 1000); } } catch (e) { displayError(e.toString()); } } } function executeChunkStateChange() { if (xmlHttp.readyState == 4) { if (xmlHttp.status == 200) { // if OK then proceed to chunkUpdate chunkUpdate(); } else { displayError(xmlHttp.statusText); } } } function chunkUpdate() { var response = xmlHttp.responseText; document.getElementById("chunksList").innerHTML = response; Sortable.create("chunksList"); document.getElementById("txtChunkTitle").value = ""; document.getElementById("txtChunkContent").value = ""; } Hope someone can help with this :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Disappearing List Bug
Hi guys, I have a list of sortable items, there are 2 droppables enabled with the list, 1 to delete it and the other to place a "linked" item in another sortable list utilising a relational database. This all works fine except for this bug: When I add an item to the second list it goes there no problem and I can sort that list, but as soon as i try to do anything with the first list all the items in the list disappear. If I manually refresh the page then they all appear again as normal. Im using AJAX with my site as well and have a separate method and php call to insert from 1 list to another. Im not sure where I this bug might be, there is a lot of relevant code so I figured id ask before posting it incase someone can assist where the error might be or perhaps a bit more specific in terms of which code I need to post. Hope someone can help this has been driving me up the wall all night! :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Disappearing List Bug
Anyone got any idea's for this? Here is a link to the site if you want to see the problem... www.pelious.co.uk/noteaid/login.html - username guest3 p/w pass To replicate the problem try adding a chunk to a page, then doing anything with the chunk list after and you will find it disappears. Thanks for taking the time to check it out. Can post any code required just as im not sure which area is at fault here didnt want to simply post reams of code. On Mar 24, 9:49 am, vanq69 wrote: > Hi guys, > > I have a list of sortable items, there are 2 droppables enabled with > the list, 1 to delete it and the other to place a "linked" item in > another sortable list utilising a relational database. > > This all works fine except for this bug: > > When I add an item to the second list it goes there no problem and I > can sort that list, but as soon as i try to do anything with the first > list all the items in the list disappear. If I manually refresh the > page then they all appear again as normal. > > Im using AJAX with my site as well and have a separate method and php > call to insert from 1 list to another. > > Im not sure where I this bug might be, there is a lot of relevant code > so I figured id ask before posting it incase someone can assist where > the error might be or perhaps a bit more specific in terms of which > code I need to post. > > Hope someone can help this has been driving me up the wall all > night! :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] LightWindow/Box on same site as drag and drop
Hi guys, Just a quickie, I want to use lightwindow or lightbox on my site, have been playing around with it and can get it to work ok but when I do it doesnt let me use drag and drop on my list. Does anyone know a way to do this? Or know if it is impossible? Its not a massive issue if I cant use lightbox but I would really like to. Hope someone can help. If its possible can post some code and perhaps someone can assist with where im going wrong. Regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---