Ok this is probably a simple ask , but im running out of time and im not finding a solution on my own. But I know its possible, so any help would be greatly appreciated. Im working on a dashboard style system that''s all mainly XML/XSL based. The dashboards are just static preset pages that import "datablocks" .. which are basically just other pages .. it then draws them in with html templates etc .. Typically <Datablock importTemplate="Dashboard/open_Calls" name="body1row3col2datablock1"/> imports a template.I want to be able to use prototype to create a DIV and fill it with one of these datablocks , so I can create these dashboards on the fly , rather than just having to create a new static layout each time. Say have a menu up the top, and just click a button to draw in the datablock of choice .. Iv seen things like this done in peoples posts , but im very new to ajax and prototype/scriptaculous .. If any one could help me , id really appreciate it .. Cheers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I typically do this by having a placeholder DIV in the document, then I add elements to that DIV and use Prototype to set the properties and content: holder = $(''root''); newBox = document.createElement(''div''); newBox.id="SAMPLE" $(newBox).addClassName("SOMETHING") $(newBox).innerHTML = "MOO" $(newBox).style.top=y+''px'' $(newBox).style.left=x+''px'' You could make an Ajax call to grab the contents and place it in your new DIV. On Jul 23, 7:34 pm, BSide <j...-8SBO/aU9k2Pby3iVrkZq2A@public.gmane.org> wrote:> Ok this is probably a simple ask , but im running out of time and im > not finding a solution on my own. But I know its possible, so any help > would be greatly appreciated. > > Im working on a dashboard style system that''s all mainly XML/XSL > based. The dashboards are just static preset pages that import > "datablocks" .. which are basically just other pages .. it then draws > them in with html templates etc .. Typically <Datablock > importTemplate="Dashboard/open_Calls" name="body1row3col2datablock1"/ > > > imports a template. > > I want to be able to use prototype to create a DIV and fill it with > one of these datablocks , so I can create these dashboards on the > fly , rather than just having to create a new static layout each > time. Say have a menu up the top, and just click a button to draw in > the datablock of choice .. > > Iv seen things like this done in peoples posts , but im very new to > ajax and prototype/scriptaculous .. If any one could help me , id > really appreciate it .. > > Cheers--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Yeah you''ve got to have the HTML element set in the document on load, then you could Ajax.Updater and just update the data into the XML. Also if you want to go a step further and send the XHR request for XML data and then just apply the XSL via javascript. On Jul 24, 2:46 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I typically do this by having a placeholder DIV in the document, then > I add elements to that DIV and use Prototype to set the properties and > content: > > holder = $(''root''); > newBox = document.createElement(''div''); > newBox.id="SAMPLE" > $(newBox).addClassName("SOMETHING") > $(newBox).innerHTML = "MOO" > $(newBox).style.top=y+''px'' > $(newBox).style.left=x+''px'' > > You could make an Ajax call to grab the contents and place it in your > new DIV. > > On Jul 23, 7:34 pm, BSide <j...-8SBO/aU9k2Pby3iVrkZq2A@public.gmane.org> wrote: > > > Ok this is probably a simple ask , but im running out of time and im > > not finding a solution on my own. But I know its possible, so any help > > would be greatly appreciated. > > > Im working on a dashboard style system that''s all mainly XML/XSL > > based. The dashboards are just static preset pages that import > > "datablocks" .. which are basically just other pages .. it then draws > > them in with html templates etc .. Typically <Datablock > > importTemplate="Dashboard/open_Calls" name="body1row3col2datablock1"/ > > > > imports a template. > > > I want to be able to use prototype to create a DIV and fill it with > > one of these datablocks , so I can create these dashboards on the > > fly , rather than just having to create a new static layout each > > time. Say have a menu up the top, and just click a button to draw in > > the datablock of choice .. > > > Iv seen things like this done in peoples posts , but im very new to > > ajax and prototype/scriptaculous .. If any one could help me , id > > really appreciate it .. > > > Cheers--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
With Prototype trunk, you can do: new Element(''div'',{id:''sample'',className:''something''}).setStyle ({top:''12px'',left:''34px''}).update(''moo''); This is very flexible when it comes to dynamically generated elements. Best, Thomas Am 25.07.2007 um 21:58 schrieb Matt:> > Yeah you''ve got to have the HTML element set in the document on load, > then you could Ajax.Updater and just update the data into the XML. > Also if you want to go a step further and send the XHR request for XML > data and then just apply the XSL via javascript. > > > > On Jul 24, 2:46 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I typically do this by having a placeholder DIV in the document, then >> I add elements to that DIV and use Prototype to set the properties >> and >> content: >> >> holder = $(''root''); >> newBox = document.createElement(''div''); >> newBox.id="SAMPLE" >> $(newBox).addClassName("SOMETHING") >> $(newBox).innerHTML = "MOO" >> $(newBox).style.top=y+''px'' >> $(newBox).style.left=x+''px'' >> >> You could make an Ajax call to grab the contents and place it in your >> new DIV. >> >> On Jul 23, 7:34 pm, BSide <j...-8SBO/aU9k2Pby3iVrkZq2A@public.gmane.org> wrote: >> >>> Ok this is probably a simple ask , but im running out of time and im >>> not finding a solution on my own. But I know its possible, so any >>> help >>> would be greatly appreciated. >> >>> Im working on a dashboard style system that''s all mainly XML/XSL >>> based. The dashboards are just static preset pages that import >>> "datablocks" .. which are basically just other pages .. it then >>> draws >>> them in with html templates etc .. Typically <Datablock >>> importTemplate="Dashboard/open_Calls" >>> name="body1row3col2datablock1"/ >> >>>> imports a template. >> >>> I want to be able to use prototype to create a DIV and fill it with >>> one of these datablocks , so I can create these dashboards on the >>> fly , rather than just having to create a new static layout each >>> time. Say have a menu up the top, and just click a button to >>> draw in >>> the datablock of choice .. >> >>> Iv seen things like this done in peoples posts , but im very new to >>> ajax and prototype/scriptaculous .. If any one could help me , id >>> really appreciate it .. >> >>> Cheers > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
i tried to do something like this and ended up making a parent element inside my html that i set to display: none when serving the page and display: block when i was designing it. then when i wanted to load dynamic content in it, i wrote a simple wrapper class that took the parent element, made a clone and gave it a random id and put all the content and styling inside. i threw the code away though cause i found an easier way to do it but it was basically something like this: <div id="templates"> <div class="article"> <h1>Header</h1> <p>Lorem ipsum...</p> </div> </div> then inside the class i used as output: initialize: function (type,data) { this.element = $("templates").down(type).cloneNode(true); .... } was handy cause i end up needing to do design and programming at once. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---