Categories | Question details Back To List | ||
dhtmlxwindow and content Id Hi, I would like to change the window content with prototype and symfony framework. But if i look with firebug i cannot find any content ID. I need to give an div id to prototype and i cannot add a div in my template because the submit form is itself. If I add a div container after the submit i will have a div container in the div container. How can i do ? thanx Olivier Answer posted by Alex (support) on Feb 25, 2009 03:24 Hi, How did you attach the content to the window ? If you used attachObject method, you passed the object id as a parameter: w.attachObject(some_id); So, this id is the id of the window content. Answer posted by Olivier Giovanelli on Feb 25, 2009 04:39 I use mywindow.attachURL(myurl); this url give me a form and i want to update the content of the window by clicking on the submit button ( form validation with symfony framework) I use prototype for that on my form but i have to give it a div id. Best regards, Olivier Giovanelli Answer posted by Support on Feb 25, 2009 05:27 Try this: // attached form <form ...> <input type="hidden" id="divId" value=""> </form> // main script if (_isIE) { dhxWins.window(id)._frame.contentWindow.document.getElementById("divId").value = ... } else { dhxWins.window(id)._frame. } Answer posted by Olivier Giovanellii on Feb 25, 2009 05:35 It's difficult to use what you just gave me because I use a php framework and I have some ajax function inside it. Example : <?php echo form_remote_tag(array(It would be great if the content div in a window could have an ID (for example the window name) . Maybe it s possible to add it in the code easily ? Best regards, Olivier Giovanelli Answer posted by Support on Feb 25, 2009 06:13 What about passing div id to attachURL() as a param and extract it in php using $_GET[]? main script >> var divId = ...; dhxWins.window(id).attachURL("phpscript.php?divId="+divId); phpscript.php >> $divId = $_GET["divId"]; Answer posted on Feb 25, 2009 06:38 Yes, but the problem is that I need an ID in the content div of the window because prototype.js need a div (id) for ajax and now i cannot give it one. I think the best way would be to be able to add an ID on the content div of a dhtmlxwindow component because the php framework is very difficult to modify... Do you think it s possible to add an ID ? Olivier Answer posted by Support on Feb 25, 2009 06:46 In case of using attachURL() windows does not use divs. Could you please provide completed demo with some comments like with from id whould be passed to? You can sent it directly to support@dhtmlx.com Answer posted on Feb 25, 2009 08:07 ok but i use attachURL with ajax Your sample. I looked with firebug <div class="dhtmlxWindowMainContent" style="overflow: hidden; position: absolute; top: 0px; bottom: 0px; left: 0px; right: 0px;"> </div> When i click on the "attach url" button , this div seems updated. So i would need an ID on this div I guess like that: <div class="dhtmlxWindowMainContent" id="MY_ID" style="overflow: hidden; position: absolute; top: 0px; bottom: 0px; left: 0px; right: 0px;"> </div>
maybe i am making a mistake , but i think that AttachURL with ajax (true) use this div. No ? Answer posted by Support on Feb 25, 2009 09:32 Right, ajax-load use div. To set any id value to <div class="dhtmlxWindowMainContent"> you can use following codeline: dhxWins.window(id)._content.childNodes[2].id = "MY_ID"; Answer posted on Feb 25, 2009 10:59 Thank you very much ...i am going to try But I think that it's what I need Best regards, |