Monday, May 2, 2011

Re: How to select a row on click of any cell in that row - Celltable

Define a SingleSelectionModel and add it to CellTable :

final SingleSelectionModel<T> ssm = new SingleSelectionModel<T>();
cellTable.setSelectionModel(ssm);
ssm.addSelectionChangeHandler(new Handler() {
    @Override
    public void onSelectionChange(final SelectionChangeEvent event)
    {
        final T selectedObject = ssm.getSelectedObject();
        // do what you want
    }
});

Alexandre

2011/4/28 kalpana anbalagan <kalpana.anbalagan@gmail.com>
Hello,

I am using GWT 2.2 CellTable. I want to select a row if i click on
any cell in that row similar to what is achieved when selecting
checkbox in the selectionmodel. As per my requirement, we are not
using Checkboxcell to select a row in celltable.

note: all the cells in the celltable are constructed using
"TextColumn".

Can anyone help me on this.

Thanks in Advance,
Kalpana

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment