[flexcoders] Another PrintDataGrid Question
Hello, i know, there was already something questions about using the PrintDataGrid but they can't help me. I have already tests the demos on the livedocs, but i have not the result, that i want. I use the PrintDataGrid not included in the layout with a dataprovider of a visibile DataGrid. mx:PrintDataGrid width=65% id=PrintGrid wordWrap=true backgroundColor=#00 fontSize=8 visible=false labelFunction=lfnGeneral ... After pressing the print button i set the attribute like in the livedocs or posts, that found here and about search engines ;) But on the printouts i have different spacings to the bottom of the page or data are cut off. Following Code is my Printfunction: var myPrintDataGrid :PrintDataGrid = new PrintDataGrid; var myPrintJob = new FlexPrintJob(); if (myPrintJob.start()) { myPrintDataGrid = this.PrintGrid; myPrintDataGrid.width = myPrintJob.pageWidth; myPrintDataGrid.height = myPrintJob.pageHeight; myPrintDataGrid.sizeToPage = true; myPrintDataGrid.dataProvider = this.InhabitantGrid.dataProvider; myPrintDataGrid.visible = false; myPrintDataGrid.includeInLayout = false; myPrintDataGrid.variableRowHeight = true; if(!myPrintDataGrid.validNextPage) { myPrintJob.addObject(myPrintDataGrid); } else { myPrintJob.addObject(myPrintDataGrid); while(true) { myPrintDataGrid.nextPage(); if(!myPrintDataGrid.validNextPage) { myPrintJob.addObject (myPrintDataGrid); validateNow(); break; } else { myPrintJob.addObject (myPrintDataGrid); } } } myPrintJob.send(); } Can anybody help me? Thx Matze
[flexcoders] First problem: Error #2006 with the MenuBar
Hello, I have a problem with the MenuBar. We have implemented the MenuBar, which was filled dynamically with XML data. Sporadically it will appear following fault, if we mousover the root layer. RangeError: Error #2006: Der angegebene Index liegt außerhalb des zulässigen Bereichs. at flash.display::DisplayObjectContainer/addChildAt() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal: :rawChildren_addChildAt() at mx.managers::SystemManager/addChild() at mx.managers::PopUpManager$/addPopUp() at mx.controls::Menu/show() at mx.controls::MenuBar/::showMenu() at mx.controls::MenuBar/::mouseOverHandler() Here a abrid ged version of our XML to create the MenuBar: Menuebar ... menu label=Artikel menu label=Artikel anlegen data=new_article / menu label=Artikel bearbeiten data=edit_article / menu label=Verpackung menu label=Verpackung anlegen data=new_package / menu label=Verpackung bearbeiten data=edit_package / /menu menu label=Materialgruppe menu label=Materialgruppe anlegen data=new_materialgroup / menu label=Materialgruppe bearbeiten data=edit_materialgroup / /menu /menu ... /Menuebar It is a well-formed XML. Thanks for your help. Matze
[flexcoders] Second problem: how to delete a component out of the storage
Hello, My second question is how to delete a component out of storage. We have some own components (basically forms), which will be created and shown by an construct e.g. var myComponent : T_Component = new T_Component ; this.addChild(myComponent) Some of our forms will be created in an popup. On every call of the popup, we lost 5 mb or more, all childs on the windows will be removed by formname.removeAllChild(); What cann we do, that the garbage collector will dispose this objects. Is there a way to show all objects with references (NOT NULL)? I have read in the Flex Help, that this.removeChild(myComponent) not delete the form and/or object out of the storage. Rather the object must be destroyed. It is sufficient to call delete(myComponent) about remove this object out of the storage as the case may be that the garbage-collector remove this object at any time? Or how can I destroy a component correctly. What happens with the widgets on this component e.g. input fields or datagrids? Are they also being deleted? Thanks for your help, too. Matze