Re: Getting data out of gwt grid

2009-01-03 Thread rcaschultz

I did not see a reply but here is what I did. Sinceyou have the store,
ask for the record at the row index and then the field name. For
instance, I have a store with fields named "property" and "value".
When I modify a value, I want the name of the "property" associated
with the value I changed. I  already get the row and column from the
listener, eg.,

addEditorGridListener(new EditorGridListenerAdapter()
{public void onAfterEdit(GridPanel grid, Record record,
String field, Object newValue, Object oldValue, 
int
rowIndex, int colIndex)

I then ask the store for the record at row (say 4), and then ask for
the value of the field "property"

store.getAt(4).getAsString("property")

This returns to me the name of the value I changed. Hope this helps.


--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Getting data out of gwt grid

2008-12-07 Thread Raz65

Thanks for the response but sorry, I got confused. I think I'm on the
wrong forum! I was actually referring to a GWT-EXT grid populated with
a Store. I think there is a significant difference. I've found the GWT-
EXT forum so I think I'll post there but if anyone can help out here
all the better.
Thanks.
Raz65

On Dec 7, 6:19 pm, "Pavel Byles" <[EMAIL PROTECTED]> wrote:
> I'm assuming you just need to get the data from the grid.
>
> This can primitevely be done using a single nested for-loop:
>
> for (int i = 0; i < myGridWidget.getRowCount(); ++i) {
>
>   for (int j = 0; j < myGridWidget.getCellCount(i); ++j) { // this is safer
> I guess since cols can span
>
>     // store data in array or some other type
>
>     arr[i][j] = myGridWidget.getText(i, j);
>
>   }
>
>
>
>
>
> }
> On Sat, Dec 6, 2008 at 7:52 PM, Raz65 <[EMAIL PROTECTED]> wrote:
>
> > Hi, I'm a new member and I'm new to GWT. In the past week I've made
> > quite good progress setting up an application to read data from mysql,
> > and via rpc, populate combo boxes and grid on the client side.
>
> > However, I'm stumped when it comes to returning records/fields back
> > out out of the grid in response to user clicks. I have set up grid
> > listeners to respond to clicks on cells, rows etc and they return me
> > the relative integers no problem. But how do I get at the actual
> > values in the fields.
>
> > I've managed to work out I have to get the store out of the grid and
> > get the record/field that I want out of the store but I'm stuck with
> > the sequence of code that I need. And it's the one thing so far for
> > which I have not been able to find an example.
>
> > Any help and code sample would be very very much appreciated.
> > Raz65
>
> --
> -Pav- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Getting data out of gwt grid

2008-12-07 Thread Pavel Byles
I'm assuming you just need to get the data from the grid.

This can primitevely be done using a single nested for-loop:

for (int i = 0; i < myGridWidget.getRowCount(); ++i) {

  for (int j = 0; j < myGridWidget.getCellCount(i); ++j) { // this is safer
I guess since cols can span

// store data in array or some other type

arr[i][j] = myGridWidget.getText(i, j);

  }

}

On Sat, Dec 6, 2008 at 7:52 PM, Raz65 <[EMAIL PROTECTED]> wrote:

>
> Hi, I'm a new member and I'm new to GWT. In the past week I've made
> quite good progress setting up an application to read data from mysql,
> and via rpc, populate combo boxes and grid on the client side.
>
> However, I'm stumped when it comes to returning records/fields back
> out out of the grid in response to user clicks. I have set up grid
> listeners to respond to clicks on cells, rows etc and they return me
> the relative integers no problem. But how do I get at the actual
> values in the fields.
>
> I've managed to work out I have to get the store out of the grid and
> get the record/field that I want out of the store but I'm stuck with
> the sequence of code that I need. And it's the one thing so far for
> which I have not been able to find an example.
>
> Any help and code sample would be very very much appreciated.
> Raz65
>
> >
>


-- 
-Pav

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Getting data out of gwt grid

2008-12-06 Thread Raz65

Hi, I'm a new member and I'm new to GWT. In the past week I've made
quite good progress setting up an application to read data from mysql,
and via rpc, populate combo boxes and grid on the client side.

However, I'm stumped when it comes to returning records/fields back
out out of the grid in response to user clicks. I have set up grid
listeners to respond to clicks on cells, rows etc and they return me
the relative integers no problem. But how do I get at the actual
values in the fields.

I've managed to work out I have to get the store out of the grid and
get the record/field that I want out of the store but I'm stuck with
the sequence of code that I need. And it's the one thing so far for
which I have not been able to find an example.

Any help and code sample would be very very much appreciated.
Raz65

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---