sheeryjay

sheeryjay


  • Name: [not set]
  • Favorite Languages: [not set]
  • Website: [not set]
  • Location: [not set]
  • About Me: [not set]

Recent Comments

  • Flex DataGrid Goodies - Row Color and Others
    04/21/2009 - 03:06

    Thanks, took me some time to actually figure what was happening but after comparison with normal DataGrid component (which behaved ok with no dataProvider) I concluded it was not wanted behaviour and wanted to give back to those helping other developers.
    Anyway I wonder how often it is that someone runs into this issue. I used to put some empty placeholder dataProvider into DataGrid tag, but I was told I should not do that and simply init it in ActionScript (as per MVC separation of roles) - since I often use complex dataProviders generated by calls to java backend.

  • Flex DataGrid Goodies - Row Color and Others
    04/19/2009 - 09:28

    If you do not set dataProvider in RowColorDataGrid tag but in ActionScript code, then it can cause trouble because Flex tries to initialize and view grid and runs overrided drawRowBackground method which does not check for dataProvider being null and raises exception.
    Solution:

    override protected function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void {
       if(rowColorFunction != null && dataProvider != null)

    That is: add check for dataProvider not being null into RowColorDataGrid.as method drawRowBackground, if it is null just let normal (super) version of drawRowBackground be run.
    Otherwise really great and helpful tutorial.

Sponsors