0 Replies Latest reply on Apr 25, 2008 4:51 PM by Tikis_Mikis

    Commincation DataGridColumn parent to headerRenderer child

    Tikis_Mikis Level 1
      OK so I am stuck I really do not know the best approach to this. I have a headerRenderer for my DataGrid component and I have a canvas with a text label with it. Its for a paged DataGrid and so I have disabled the sorting for the columns and I sort by an event handler when the hearderRenderer is clicked. However since sorting has been disabled no arrow pointer is displayed so I am making my own by drawing a triangle with a Shape object. All I need to know is

      1. How to dispatch a custom event from the parent to the headerRender telling it that a triangle needs to be drawn for the current headerRenderer and in which direction


      2. How to pass extra data from where I instantiate my DataGridColumn to the headerRenderer.

      Here is how I declare my DataGridColumns before adding them to the DataGrid.columns attribute:

      var newColumn:DataGridColumn = new DataGridColumn();
      newColumn.headerText = gridColumns[key]['title'];
      newColumn.headerRenderer = new ClassFactory(ColumnHeaderRenderer);

      I just wish there was a way to send to the headerRenderer something like this pseudocode: newColum.data = new Array([{"sortDirection": "1", "sortField": "first_name"}])

      And then from within the header renderer I can do this: sortDirection = value.data.sortDirection much like the way you send the values from a parent DataGrid to an ItemRenderer.

      I found this post on bubbling events from parent to child BUT I really cant get it working. Can an example be shown?
      Bubbling Posth

      In the end ALL I need to know how to do is HOW to communicate/send extra data from the parent to the child (DataGrid to headerRenderer).