Flex datagrid with checkbox in One column
hi,
i have datagrid 1 columb checkboxes, datagrid has itemdoubleclick event , checkbox has click event.
but want have doubleclick event checkbox. everytime double click checkbox , calls itemdoubleclick event of datagrid.........
i dont want call itemdoubleclick event when doubleclick checkbox???
solution
mxml file
<mx:datagrid id="iddgmereditlocations" left="10" right="10" top="50" bottom="10"
dataprovider="{arrlocedit}" doubleclickenabled="true"
doubleclick="iddgmereditlocations_itemdoubleclickhandler(event)"
stylename="datagridstyle" fontfamily="open sans" color="#000000" headerheight="29" chromecolor="#5d5d5d" borderstyle="none" verticalgridlines="false" variablerowheight="true">
<mx:columns>
<mx:datagridcolumn visible="false" datafield="locid"
headertext="location id"/>
<mx:datagridcolumn visible="true" width="180" datafield="nameloc"
fontfamily="arial" fontsize="12" fontweight="bold"
headerstylename="boldwhite" headertext="location"
resizable="false" sortable="true" textalign="left"
textindent="10" wordwrap="true"/>
<mx:datagridcolumn visible="true" width="200" datafield="addline1loc"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="addr line1"
resizable="false" sortable="false" textalign="left"
textindent="10" wordwrap="true"/>
<mx:datagridcolumn visible="true" width="100" datafield="addline2loc"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="addr line2"
resizable="false" sortable="false" textalign="left"
textindent="10" wordwrap="true"/>
<mx:datagridcolumn visible="true" width="110" datafield="phoneloc"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="phone"
resizable="false" sortable="false" textalign="left"
textindent="10" wordwrap="true"/>
<mx:datagridcolumn visible="true" width="60" datafield="zipcodeloc"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="zip code"
resizable="false" sortable="true" textalign="right"
textindent="10" wordwrap="true"/>
<mx:datagridcolumn visible="false" datafield="country.namecountry"
fontfamily="arial" fontsize="12" fontweight="normal"
headertext="country" resizable="false"
sortable="false" textalign="left" textindent="10"
wordwrap="true"/>
<mx:datagridcolumn visible="false" datafield="statedomain.statename"
fontfamily="arial" fontsize="12" fontweight="normal"
headertext="state" resizable="false" sortable="false"
textalign="left" textindent="10" wordwrap="true"/>
<mx:datagridcolumn visible="false" datafield="statedomain.stateid"
fontfamily="arial" fontsize="12" fontweight="normal"
headertext="stateid" resizable="false"
sortable="false" textalign="left" textindent="10"
wordwrap="true"/>
<mx:datagridcolumn visible="false" datafield="city.cityname"
fontfamily="arial" fontsize="12" fontweight="normal"
headertext="city" resizable="false" sortable="false"
textalign="left" textindent="10" wordwrap="true"/>
<mx:datagridcolumn visible="false" width="60" datafield="servicedinein"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="dinein"
resizable="false" sortable="true" textalign="center"
textindent="0" wordwrap="false"/>
<mx:datagridcolumn visible="false" width="60" datafield="servicetakeout"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="takeout"
resizable="false" sortable="true" textalign="center"
textindent="0" wordwrap="false"/>
<mx:datagridcolumn visible="false" width="60" datafield="servicedelivery"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="delivery"
resizable="false" sortable="true" textalign="center"
textindent="0" wordwrap="false"/>
<mx:datagridcolumn visible="true" width="60" datafield="statusloc"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="activated"
resizable="false" sortable="true" textalign="center"
textindent="0" wordwrap="false" >
<mx:itemrenderer><fx:component>
<mx:vbox horizontalalign="center">
<fx:script>
<![cdata[
import mx.collections.arraycollection;
import mx.controls.alert;
import mx.controls.checkbox;
import mx.core.flexglobals;
import mx.utils.objectutil;
[bindable]
public var cbselected:boolean;
protected function idchkstatusloc_clickhandler(event:mouseevent):void
{
// todo auto-generated method stub
data.statusloc = idchkstatusloc.selected
outerdocument.activedeactivelocation(idchkstatusloc.selected);
//alert.show("idchkstatusloc_clickhandler" +iddgmereditlocations.selectedindex+objectutil.tostring(arrlocedittemp));
// alert.show("single click ");
}
protected function idchkstatusloc_doubleclickhandler():void{
// alert.show("double click ");
}
]]>
</fx:script>
<s:checkbox id="idchkstatusloc"
chromecolor="white"
click="data.statusloc = idchkstatusloc.selected"
selected="{data.statusloc}"
skinclass="assets.skins.customcheckboxskin"
symbolcolor="white"
doubleclick="idchkstatusloc_doubleclickhandler()" doubleclickenabled="false" />
</mx:vbox>
</fx:component></mx:itemrenderer>
</mx:datagridcolumn>
<mx:datagridcolumn visible="false" width="60" datafield="faxselect"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="fax enable"
resizable="false" sortable="true" textalign="center"
textindent="0" wordwrap="false"/>
<mx:datagridcolumn visible="false" width="60" datafield="smsselect"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="sms enable"
resizable="false" sortable="true" textalign="center"
textindent="0" wordwrap="false"/>
<!-- 4 july 2015 -->
<mx:datagridcolumn visible="true" width="60" datafield="posloc"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="is pos"
resizable="false" sortable="true" textalign="center"
textindent="0" wordwrap="false"/>
<!-- 4 july 2015 end -->
<!-- 18 feb 2016 -->
<mx:datagridcolumn visible="true" width="75" datafield="noofposlicence"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="#purchased"
resizable="false" sortable="true" textalign="center"
textindent="0" headerwordwrap = "true"/>
<mx:datagridcolumn visible="true" width="75" datafield="noofposlicenceused"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="#used"
resizable="false" sortable="true" textalign="center"
textindent="0" headerwordwrap = "true"/>
<mx:datagridcolumn visible="true" width="50" fontfamily="arial"
fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="delete"
resizable="false" sortable="false" textalign="center"
textindent="0" wordwrap="false">
<mx:itemrenderer><fx:component>
<mx:hbox horizontalalign="center">
<fx:script>
<![cdata[
import mx.controls.alert;
import mx.core.application;
import mx.core.flexglobals;
import mx.events.closeevent;
protected function del_clickhandler(event:mouseevent):void
{
/* alert.show( "confirm record delete", "warning",
alert.yes | alert.no, this, closehandler, outerdocument.iconwarning, alert.yes ); */
outerdocument.deletealert();
}
]]>
</fx:script>
<mx:image id="idimgdel" buttonmode="true"
click="del_clickhandler(event)"
source="assets/u121_original.png"/>
</mx:hbox>
</fx:component></mx:itemrenderer>
</mx:datagridcolumn>
<!-- 18 feb 2016 end -->
<!--<mx:datagridcolumn visible="false" width="60" datafield="faxloc"
fontfamily="arial" fontsize="12" fontweight="normal"
headerstylename="boldwhite" headertext="fax"
resizable="false" sortable="true" textalign="center"
textindent="0" wordwrap="false"/>-->
</mx:columns>
</mx:datagrid>
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment