How to center a checkbox in an extended DataGrid


hello,

 

i have added checkbox column in extended datagrid. works fine unable vertically or horizontally align checkbox inside datagrid.

 

here grid mxml:

            <datagridfilters:filterdatagrid headerheight="85" id="dg"
                                            draggablecolumns="false"
                                            sortablecolumns="false"
                                            width="100%" height="100%"
                                            dataprovider="{devicedatacoll}"
                                            click="dg_clickhandler(event)"
                                            borderstyle="solid" resizablecolumns="false" editable="false"
                                            rowcount="{devicedatacoll.length}"
                                            allowmultipleselection="true"
                                            horizontalscrollpolicy="auto"
                                            verticalscrollpolicy="auto"
                                            creationcomplete="assignlistener()"
                                            verticalalign="middle"
                                       
                                            >
                <datagridfilters:columns>
                                   
                    <datagridfilters:datagridfiltercolumn headertext="&#13;select" width="75" textalign="center">
                        <datagridfilters:itemrenderer>
                            <fx:component>
                                <datagridfilters:gridcheckbox>
                                    <fx:script>
                                        <![cdata[
                                            import filters.columnselectedevent;
                                           
                                            protected function sendclick(event:mouseevent):void
                                            {
                                                var event2:columnselectedevent = new columnselectedevent( columnselectedevent.column_selected, this.listdata.columnindex, this.selected ); 
                                                dispatchevent( event2 );
                                            }
                                        ]]>
                                    </fx:script>                                   
                                </datagridfilters:gridcheckbox>
                            </fx:component>
                        </datagridfilters:itemrenderer>
                    </datagridfilters:datagridfiltercolumn>
                       
                    <datagridfilters:datagridfiltercolumn datafield="xxxx" headertext="&#13;group 1" width="75" textalign="center" />
                   
                </datagridfilters:columns>
            </datagridfilters:filterdatagrid>

 

 

 

 

in gridcheckbox class file, in constructor have tried this:

    import mx.controls.checkbox;

 

    public class gridcheckbox extends checkbox
    {
        public function gridcheckbox() {
            this.setstyle('verticalalign','middle');
            this.setstyle('horizontalalign','center');
            super();
        }
           
       
        override protected function updatedisplaylist(unscaledwidth:number, unscaledheight:number):void
        {
            super.updatedisplaylist(unscaledwidth, unscaledheight);
            textfield.stylename = 'inputcheckboxlabel';
            textfield.y = 3;
        }       
       
    }

 

 

 

when "setstyle" not seem work , cannot figure out way make happen.

 

any suggestions?

setstyle doesn't work on uitextfield.  picks styles the

parent component.  reposition checkbox icon.



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Hur installera Joomla på One.com - Joomla! Forum - community, help and support

removing index.php from URL address - Joomla! Forum - community, help and support

「イメージマップのアンカー名には、...」のエラーが出ないようにしたい