gwt - Adding a dropdown or toggle button to DataGrid -


is there way add dropdown button or toggle button celltable or datagrid?

the documentation demonstrates using regular button (buttoncell).

to add togglebutton grid, way found place button in panel (like flowpanel) add panel in grid.

to found type of button, can visit showcase of gwt :

http://samples.gwtproject.org/samples/showcase/showcase.html#!cwcustombutton

here code have button in flowpanel :

rootlayoutpanel rp = rootlayoutpanel.get(); flowpanel togglepanel = new flowpanel(); togglebutton toggle = new togglebutton("coucou"); toggle.setwidth("100px"); togglepanel.add(toggle); rp.add(togglepanel); 

css :

.gwt-togglebutton-up, .gwt-togglebutton-up-hovering, .gwt-togglebutton-up-disabled, .gwt-togglebutton-down, .gwt-togglebutton-down-hovering, .gwt-togglebutton-down-disabled {   margin: 0;   text-decoration: none;   background: url("images/hborder.png") repeat-x 0px -27px;   -moz-border-radius: 2px;   border-radius: 2px; }  .gwt-togglebutton-up, .gwt-togglebutton-up-hovering, .gwt-togglebutton-up-disabled {   padding: 3px 5px 3px 5px; }  .gwt-togglebutton-up {   border:1px solid #bbb;   border-bottom: 1px solid #a0a0a0;   cursor: pointer;   cursor: hand; }  .gwt-togglebutton-up-hovering {   border: 1px solid;   border-color: #939393;   cursor: pointer;   cursor: hand; }  .gwt-togglebutton-up-disabled {   border: 1px solid #bbb;   cursor: default;   opacity: .5;   zoom: 1;   filter: alpha(opacity=45); }  .gwt-togglebutton-down, .gwt-togglebutton-down-hovering, .gwt-togglebutton-down-disabled {   padding: 4px 4px 2px 6px; }  .gwt-togglebutton-down {   background-position: 0 -513px;   border: 1px inset #666;   cursor: pointer;   cursor: hand; }  .gwt-togglebutton-down-hovering {   background-position: 0 -513px;   border: 1px inset;   border-color: #9cf #69e #69e #7af;   cursor: pointer;   cursor: hand; }  .gwt-togglebutton-down-disabled {   background-position: 0 -513px;   border: 1px inset #ccc;   cursor: default;   opacity: .5;   zoom: 1;   filter: alpha(opacity=45); } 

it basic css took on showcase. should modify it.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -