6 Replies Latest reply on Mar 13, 2010 3:58 AM by bornaeon

    RTL Direction in DataGrid columns with Gumbo...

    bornaeon Level 1

      Hi everybody

      I have a datagrid, that I want to set it's columns with "Right-to-Left" Direction.

      But I think that I can't use a spark tag in mx one. my code is here:


              

      <mx:DataGridColumn headerText="SomeName" dataField="SomeName">              
          <mx:itemRenderer>
              <fx:Component>
                  <s:RichText>
                      <s:TextFlow direction="rtl">
                          The RTL Text
                      </s:TextFlow>
                  </s:RichText>          
              </fx:Component>
          </mx:itemRenderer>
      </mx:DataGridColumn>



      and I have this error:

      Error #1034: Type Coercion failed: cannot convert WST_inlineComponent1@1a3030a1 to mx.controls.listClasses.IListItemRenderer


      Can someone help me please...

      TanQ

        • 1. Re: RTL Direction in DataGrid columns with Gumbo...
          Flex harUI Adobe Employee

          s:RichText is not an IListITemRenderer.  Wrap it in a

          s:MXDataGridItemRenderer.

          • 2. Re: RTL Direction in DataGrid columns with Gumbo...
            bornaeon Level 1

            TanQ for your reply.

            But how can I do that?

            Would you mind if I ask you describe it more for me? How can I implement it on my code, above?

             

            TanQ again...

            • 3. Re: RTL Direction in DataGrid columns with Gumbo...
              bornaeon Level 1

              I did this:


              <mx:DataGridColumn headerText="SomeName" dataField="SomeName">              
                  <mx:itemRenderer>
                      <fx:Component>

                          <s:MXDataGridItemRenderer>
                              <s:RichText>
                                  <s:TextFlow direction="rtl">
                                      The RTL Text
                                  </s:TextFlow>
                              </s:RichText>          

                          <s:MXDataGridItemRenderer>
                      </fx:Component>
                  </mx:itemRenderer>

              </mx:DataGridColumn>


              but I have this error now:

              Could not resolve <s:MXDataGridItemRenderer> to a component implementation.

               

              • 4. Re: RTL Direction in DataGrid columns with Gumbo...
                Flex harUI Adobe Employee

                Are you running the latest build?  MXDataGridItemRenderer was introduced

                after beta2

                • 5. Re: RTL Direction in DataGrid columns with Gumbo...
                  bornaeon Level 1

                  Now, I'm using latest nightly build of gumbo's SDK (ver flex_sdk_4.1.0.14651)


                  But there is another error

                  ArgumentError: NewElement not of a type that this can be parent of
                      at flashx.textLayout.elements::FlowGroupElement/replaceChildren()[C:\Vellum\branches\v1\1.0\ dev\output\openSource\textLayout\src\flashx\textLayout\elements\FlowGroupElement.as:772]
                      at flashx.textLayout.elements::FlowGroupElement/set mxmlChildren()[C:\Vellum\branches\v1\1.0\dev\output\openSource\textLayout\src\flashx\text Layout\elements\FlowGroupElement.as:184]
                      at flashx.textLayout.elements::TextFlow/set mxmlChildren()[C:\Vellum\branches\v1\1.0\dev\output\openSource\textLayout\src\flashx\text Layout\elements\TextFlow.as:566]
                      at spark.components::RichText/createTextFlowFromContent()[E:\dev\4.x\frameworks\projects\spa rk\src\spark\components\RichText.as:1226]
                      at spark.components::RichText/commitProperties()[E:\dev\4.x\frameworks\projects\spark\src\sp ark\components\RichText.as:999]
                      at mx.core::UIComponent/validateProperties()[E:\dev\4.x\frameworks\projects\framework\src\mx \core\UIComponent.as:7885]
                      at mx.managers::LayoutManager/validateClient()[E:\dev\4.x\frameworks\projects\framework\src\ mx\managers\LayoutManager.as:863]
                      at mx.controls::DataGrid/http://www.adobe.com/2006/flex/mx/internal::setupRendererFromData()[E:\dev\4.x\frameworks\ projects\framework\src\mx\controls\DataGrid.as:1978]
                      at mx.controls::DataGrid/commitProperties()[E:\dev\4.x\frameworks\projects\framework\src\mx\ controls\DataGrid.as:1928]
                      at mx.core::UIComponent/validateProperties()[E:\dev\4.x\frameworks\projects\framework\src\mx \core\UIComponent.as:7885]
                      at mx.managers::LayoutManager/validateProperties()[E:\dev\4.x\frameworks\projects\framework\ src\mx\managers\LayoutManager.as:572]
                      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:730]
                      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1072]


                  • 6. Re: RTL Direction in DataGrid columns with Gumbo...
                    bornaeon Level 1

                    And there is another problem...

                    Please, look at this:


                              <ns:DataGridColumn headerText="FirstName" dataField="FirstName">
                                   <ns:itemRenderer>
                                        <fx:Component>                       
                                               <ns:Label />
                                        </fx:Component>
                                   </ns:itemRenderer>
                              </ns:DataGridColumn>


                    Everything's allright and I have my FirstName data, from my webservice in this column. But if I want to set rtl direction on my data in this column, like this:


                              <ns:DataGridColumn headerText="FirstName" dataField="FirstName">
                                    <ns:itemRenderer>
                                         <fx:Component>                       
                                              <s:MXDataGridItemRenderer>
                                                  <s:Label direction="rtl" />
                                             </s:MXDataGridItemRenderer>

                                         </fx:Component>
                                    </ns:itemRenderer>
                               </ns:DataGridColumn>


                    After running project, there is no error, but this column is empty...

                    What is your Idea?!