Custom datagrid headerRenderer keeps redrawing

I have two DataGrids.  One that uses default headerRenderers, and one that uses custom 'filterable' headerRenders for 5 of the column headers.
Basically, the custom filterable headerRenderer is a VBox that holds a Label and a TextInput.  Typing in the textInput will hide items in that column that don't match the filter value entered.
This issue is that each time I update these DataGrids' dataProvider, the DataGrid that employs the custom headerRenders flashes multiple times (redraws) which is very noticable -- it makes the page a little laggy.  If I override the 'data' setter and place a breakpoint in the custom headerRenderer, I see it is getting hit a ton of times! (even if there is only like 1 item in the data grid!) why is that?
How can I stop this redraw from occuring?  Can I stop the custom headerRenderer from calling the data setter? I tried overriding the data setter, placing only a return in the method --- that didn't seem to help.
Any suggestions?
thanks,
Muad'Dib

sorry for the late response pml...
Yes, I did get this fixed. I wish I could say it was an easy fix to find! but it wasn't!
Basically, I had to keep the 'state' (data members I wanted displayed by the headerRenderer) of the renderer within the parent DataGrid component. I did this by:
1) Creating necessary headerRenderers using the ClassFactory (instead of inline MXML -- you can make the call to create the headers on the DataGrid's creationComplete event).
2) setting ClassFactory 'property' to an array of objects that map the headerRenderer to the Object that hold's it's 'State'.
3) overrode initializationComplete() method of headerRender and placed any initialization code here (in lieu of the 'data' setter).  This was where the implementation that actually does the mapping to the Object that holds this render's 'State' is done, based on the data that was placed into the 'properties' field from step 2.
here's a brief example:
DataGrid
========
<mx:Box styleName="BoxContent" width="100%" height="100%">
    <mx:Script>
        <![CDATA[
                public var greeting:String = "hello";
               public function createCustomHeaders():void {
                     // create a factory that can produce your custom header
                     var customRendererFactory:ClassFactory = new ClassFactory(MyCustomRendererClass);
                     // set the properties of the factory to hold a reference to data
                     // in THIS class (Box)
                     customRendererFactory.properties = {stateHost: this, stateProperty: "greeting"};
                     // set the data grid columns renderer now...
                     dgc1.headerRenderer = customRendererFactory;
            }]]>
     </mx:Script>
     <mx:DataGrid id="dg" dataProvider="{_myData}" creationComplete="createCustomHeaders()">
        <mx:columns>
                <mx:DataGridColumn id="dgc1"
                    textAlign="center"/>
        </mx:columns>
     </mx:DataGrid>
</mx:Box>
Renderer
========
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%">
<mx:Script>
<![CDATA[
    // reference to object that will hold any necessary state information
    public var stateHost:Object;
    public var stateProperty:String;
            private var _greeting:String;
            private var _greetingUpdated:Boolean;
override protected function initializationComplete():void {
if(_greeting != stateHost[stateProperty]){
                    _greeting == stateHost[stateProperty]);
                    _greetingUpdated = true;
                    invalidateProperties();
override protected function commitProperties():void {
                super.commitProperties();
if(_greetingUpdated){
myLabel.text = (null != _greeting) ? _greeting : "";
]]>
</mx:Script>
    <mx:Label id="myLabel" width="100%"/>
</mx:VBox>

Similar Messages

  • How to force datagrid headerRenderer to redraw itself?

    Hi guys,
        I had datagrid headers that blinks however, I want to turn the blinking off by assigning a new value of a property inside the headerRenderer. The newly assigned value is indeed stored in the property. But my problem is how to force this headerRenderer to redraw itself so it will execute the "override public function prepare(hasBeenRecycled:Boolean)" function as it has the condition that turns the blinking on or off.
    Any ideas?
    I had this worked but I have to get all the columns object and assign it to an arrayList then set the datagrid's columns to null and apply the arrayList. This works so perfectly in turning on or off the blinking. But this also scrolls up the datagrid back to top which I don't want to happen in my case.
    Ideas are much appreciated.
    Thanks in advance.

    Flex harUI wrote:
    I would move the blink logic to a shared function and have the renderer listen for a change event on some property and run that function.
    Thanks for the idea. That indeed makes sense! However, how do I assign a new value to some property inside the headerRenderer when PropertyChangeEvent only supports collection classes and ObjectProxy?
    example:
    from
    myHeaderRenderer.properties = {blink: true};
    to
    myHeaderRenderer.properties = {triggerObject.blink: true} // or triggerObject['blink']: true doesn't work either.
    Unless there is a way for the headerRenderer to listen to a property change outside of itself (referencing to the parent objects)
    OR
    a way to call a function inside the headerRenderer from the main (parent) document.
    Thanks in advance for your reply Flex harUl.

  • Firefox keeps redrawing images

    I have spotted a performance issue which seemed awfully odd at the beginning.
    On this page at least :
    http://designshack.net/articles/graphics/design-a-rockin-band-website
    The page was obviously idle, the blinking ads were disabled with AdBlock. However, the CPU usage remains constant and high (22-35% with xorg-ati drivers, 45-56% CPU with amd proprietary drivers, Radeon 7290 and AMD C70), and is worse when there are images in the viewport.
    Enabling the repainted areas highlight showed me that every image in the page was constantly redrawn (the full area). I found out that the DOM elements have a .gif background-image (a typical AJAX spinner set with CSS).
    That is, even if I can't see the animation, Firefox keeps redrawing the entire container and hogs CPU. I don't know what Chrome does, but it correctly considers the area as not to be repainted, and saves CPU.
    Obviously visiting about:config and setting animation_mode to none sort of fixes the problem. But it's not a real solution. Have I missed something ? Does everyone have the same problem ?

    Tested in safe mode (had to reset the animation_mode setting too), and the images in the article content (those with background-image set to a .gif) are constantly repainted again.
    This behaviour has been consistently reproduced on Ubuntu 13.04 and 13.10, on four computers (with AMD, Intel and NVidia chips)

  • Sort Arrow for custom datagrid

    Hi,
    I have a custom datagrid where i am handling the  DataGridEvent.HEADER_RELEASE event . Also i have created custom data grid header which is assigned to the header class of custom datagrid.
    But i am facing problem while showing sortArrow. sortArrow is not visible for datagrid headers. How to show sortArrow??

    Thanks Alex.
    I managed to get the function to work when I applied it to a button, but it only works when the datagrid has a dataprovider already set for it.
    My issue is that I will have several buttons, each button will supply the datagrid with a new dataprovider.  The sort function will need to sort the first row of each column, and display the arrow each time the dataprovider is changed.
    I have added this code to one of the buttons for testing:
    private function grid_sort():void
                array1.sort = new Sort();
                array1.fields = [new SortField("column1", false, false)];
                array1.refresh();
    private function buttonClick(event:MouseEvent):void
                    grid1.dataProvider = array1;
                    grid_sort();  
    Specifically, the buttonClick function is what I added to the button's Click event.
    The code populated the datagrid when the button is clicked, however, the grid_sort() function does not execute and the arrow does not appear.
    How can I make this function work, while dynamically changing the dataprovider?

  • Custom DataGrid problems with Comboboxes

    I am using a custom datagrid with comboboxes and
    colorpickers. I found this code on the web and adapted it to work
    with my code. The only problem is that if you pull down a combobox
    and then click somewhere outside without selecting anything, it
    seems to erase the data in the dataprovider arraycollection and so
    'value' in the set data method becomes null.

    This is not a bug if I understand you properly. I believe most people would wish anything which is obtained via the tv to be backed up, which is why the content is transferred. If you want it to remain available on the tv you will need to sync it back to it.

  • DataGrid headerrenderer refresh issue -Please help

    hi
    I have a datagrid and I am  doing a custom sorting on the grid(by getting data from DB).
    I achieve this by capturing the headerrelease event of datagrid .In thee venthandler I will query from DB and do event.preventdefault to prevent standard grid sorting.
    Now I need to display my own custom ascending/descending arrows in the header.i have created an header renderer for this,
    In the headerrenderer I am lsitening to the headerrelease event of datagrid and in the eventlistener, as per the sortfield, i am trying to make the sort arrow visible/invisible.
    But somehow making the sort arrows visible/invisible is not working.The initial arrow works fine.it is shown the correct column(Name) as done in the init() method.
    The eventhandler is invoked on clicking the column headers and all the alerts are shown.
    Please see the headerrenderer code below and help me.(code is not complete only the relevant part is included)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox
    xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" horizontalScrollPolicy="off" creationComplete="init()" implements="mx.controls.listClasses.IDropInListItemRenderer">
    public function init():void
    headerLabel = dataField.label;
    _dataGrid.addEventListener(DataGridEvent.HEADER_RELEASE,sortChanged,false);
    if(_dataField.localeCompare('Name')==0)asc.visible=true;
    private function sortChanged(e:DataGridEvent)
    var dg:DataGrid=e.currentTarget asDataGrid;
    varcolumn:DataGridColumn = DataGridColumn(e.currentTarget.columns[e.columnIndex]);
    if(_dataField.localeCompare(e.dataField)==0)
    if(asc.visible ||(!asc.visible&&!desc.visible))
      Alert.show('in..');
      asc.visible=false;
      desc.visible=true;
    else if(desc.visible)
      asc.visible=true;
      desc.visible=false;
    else
    asc.visible=false;
    desc.visible=false;
    ]]>
    </mx:Script>
    <mx:Text text="{_headerLabel}" />
    <mx:Image source="{ascIcon}" id='asc' visible="false">
    <mx:Image source="{descIcon}" id='desc' visible="false"/>
    </mx:HBox>

    I got the solution!!
    i need to assign the headerrendereer to the columns dynamically inorder for this to work:
    if anybody wants to know details of solution let  me know

  • Customizing Datagrid's HeaderColumn

    I created a custom HeaderRenderer for a DataGrid. Looking at the attached image in the "Station" column, how can have the sort Arrow and it's background change to the same color(blue) as the the custom HeaderRenderer's? Also, is there anyway to edit/alter the location of that arrow?
    Thanks, in advance.

    .....bump
    Thanks!

  • Custom color-palette keeps becoming read-only and will not let me add new swatches

    I need to make a custom colour palette for work that i can open on different adobe programs, share with others and add new swatches to as I go. I create a custom palette, save it a custom name but whenever I re-open it, it has become a read-only palette and I can no longer add custom swatches to it. How do I get around this problem if I need to keep adding colours to my custom palettes?
    Thanks

    In case you need to keep swatches from the ASE:
    create a new document
    empty the swatches panel
    add all the swatches from the ASE into that document's swatches panel
    add new colors as swatches
    from the swatches panel's menu select "save library"
    Also see the manual on creating swatches.

  • Mouse focus in custom DataGrid ItemRenderer (re-post*)

    * I already posted this question in the "Flex" forum, but didn't get any replies. I'm not sure if this will yield any different results, but I figure it's worth a try...
    I have a custom MXDataGridItemRenderer with a custom nested Spark CheckBox component that I'm trying to use within an MXDataGrid component. The renderer works fine, as does the nested checkbox, however I'm unable to decouple the mouse events for the checkbox from the DataGrid row. I intend to use the DataGrid as a playlist for the VideoPlayer component with an FX Model-based DataProvider and the purpose of the checkbox is to allow the user to automatically play the next selected checkbox item in the list; similar to the checkboxes in iTunes. Placing an instance of the checkbox on top of DataGrid achieves the desired decoupling, but this is obviously an impractical solution, which I include only to illustrate what I'm trying to do. Any recommendations would be greatly appreciated.
    Thanks,
    ~Benny

    Work around posted here: http://forums.adobe.com/message/3160303#3160303

  • Customer service phones keep disconnecting me

    This is ridiculous. I've been trying for over a hour to get in touch with customer service (I use that term lightly) and keep getting told all offices are closed and then I get disconnected. If you don't want my business after being a customer for 15 years I'll be more than happy to go elsewhere.

    Jfarley75 wrote:
    This is ridiculous. I've been trying for over a hour to get in touch with customer service (I use that term lightly) and keep getting told all offices are closed and then I get disconnected. If you don't want my business after being a customer for 15 years I'll be more than happy to go elsewhere.YOu can also try the online chat feature by clicking here:  https://www.comcastsupport.com/ChatEntry/Protected.aspx 

  • Where do you go for help when the customer service rep keeps hanging up on you saying your phone is breaking up and I am on a landline where I bought my verizon plan

    I sign up with Verizon on 08/04/2014 new plan new phones switched carries. It has been A nightmare. First I purchased one plan with two phones. They set up two accounts charging me for both on two different account numbers.  On August 11th I was told it was fixed by a local Verizon REP. Said it was a computer glitch. Now . Today I received two more bills , still two account and they even contain extra charges as if I was moving my telephones back and forth. Excessive over billing and still two account. When into store where I purchased because they knew I had this problem. They has me call customer service from the store telephone. After 1 hour on the phone with a rude person, the rep.  at the store and me both talked to her. She started saying your phone is breaking up hello are your still there. I was on a land line  then she put me on hold until I finally hung up. about 20 minutes. because I was already late going back to work. I have spent hours trying to get this fixed and now I have had the service for 30 days so I can not cancel. Does anyone know where to go for some help.

    http://www.BBB.org
    File a complaint they will call you.
    Or take them to court for the over billing and your loss time from work to file and go to small claims court. Include the filing fee.
    Either way bring all your paperwork to have the judge look at.
    Good Luck

  • Customizing DataGrid component in Flash CS3 using AS3

    Can anyone please explain how to customize the DataGrid
    component in Flash CS3 using AS3???
    How do you remove/change the grid lines for the rows and
    colums?
    How do you remove/change the border?
    My day has been lost searching for this answer. Flash
    Documentation is worthless and Google finds nothing with regards to
    AS3. ASDGRH.
    Thanks in advance,
    TedWeb

    I hope you've found a resolution to this by now, but I just noticed the discussion title when posting a captioning issue.
    In a nutshell, create a listener on your FLVPlayback module with a VideoEvent.SKIN_LOADED event. You'll also need to set the showCaptions in your FLVPlaybackCaptioning object to true. Apparently, if the captions are set to false when the player object loads the skin, the captions aren't recognized and your captions toggle will require an extra click to activate the captions.
    Here's the link to another discussion on the same topic with all of the details:
    http://kb2.adobe.com/cps/402/kb402452.html
    Also, have you had any issues with the caption button in the FLVPlayback skin not showing up? That's my current issue. Here's the discussion for it:
    http://forums.adobe.com/thread/796423?tstart=0

  • Changing dataProvider of custom dataGrid to XCelsius Cells

    Hi everybody,
    I have quite a simple question, however, I do not really get a solution for that on my own.
    Actually, all I want to do is extend a usual Datagrid to display my data from XCelsius using the standard propertysheet. The way I tried to do this was to make the dataProvider inspectable.
    My actionscript file:
    package myPackage
         import mx.controls.DataGrid;
         [CxInspectableList("dataProvider")]
         public class MyDG extends DataGrid
              public function MyDG()
                   super();
              [Inspectable(defaultValue="undefined", type="Array2D")]
            [ArrayElementType("Number")]
              override public function get dataProvider():Object
                   return super.dataProvider;
              override public function set dataProvider(value:Object):void
                   super.dataProvider(value);
    When I pack this into an .xlx, I can view it and preview it as long as I do not try to change the dataProvider. When changing it, the preview window stops to load at some point.
    Thanks for your help in advance!

    Hi Sreelekha,
    This is how Flex creates 2d arrays so Xcelsius does the same when it passes a 2d array.
    var cells:Array =
       /* row 1 */   [ column 1, column 2, column 3],
       /* row 2 */   [ column 1, column 2, column 3],
       /* row 3 */   [ column 1, column 2, column 3]
    So in your case:
    var cells:Array =
        [P1, C1],
        [P2, C2]
    So cells.length tells you how many rows are in the 2d array.
    And cells[0].length tells you how many columns are in the first row of the array (assuming there is at least one row).
    So as in Flex if you want to process a Flex 2d array you do something like this:
    for (var i:int = 0; i < cells.length; i++)
        var row:Array = cells<i> as Array;
        for (var j:int = 0; j < row.length; j++)
           var rowColCell:* = row[j];
           // rowColCell has the value for this row/column cell.
    Regards
    Matt

  • Custom datagrid sort

    Hello,
    I have a datagrid that has a row that contains information
    similar to this: 1,2,3,4,T4,T4,5,6,..17,29,..43,T44,T44,45.. and so
    on.. I hope you get the idea.. if an element appears more than one
    time, it has a "T" at the beginning (this data is from a database
    and I have to display it in this way). I have to be able to sort
    this numerically (making the sort function somehow ignore that
    "T")... i know datagrid only sorts strings, but using a Listener
    and some other things ( check this out
    http://www.flash-creations.com/notes/servercomm_database.php
    ) I managed to make it sort numbers.
    However, the function doesn't work properly it some elements
    have that "T" at the beginning. Is there an elegant way to do this?
    (other than writing my own sorting function - maybe bubble sort -
    sorting the dataprovider and then repopulating the datalist with
    the sorted dataprovider)

    Could you put the "T" in a different column or does it have
    to be in the same column as the number?

  • Custom preset not keeping h.264 multi-pass setting

    I'm trying to make a custom h.264 preset. I select multi-pass and CD/DVD delivery. But when I save the preset, it reverts back to single-pass / Download.
    Is this a bug?

    Hey !
    I'm having the same problem. I just exported a bunch of reference movies out of FCP because I wanted to compress them to H.264 overnight. When I try to make a preset in Compressor with Multi-Pass, I get the same problem.
    (No problem in setting Multi-Pass from QT Conversion in FCP...)
    What's up with this?
    I'm running Compressor 2.0.1 with QT 7.1.1 and OS 10.4.7

Maybe you are looking for