View Full Version : Simple editable array with gridpanel - looking for!

Dec 11, 2009, 5:11 PM
After checking out the samples in the samples explorer and not getting it, I turn to this spot.

I want to use a gridpanel to make a small list I have in an array, editable (add-edit-remove) but I'm having problems doing so.

First I can't make the gridpanel to show the array contents. Second I don't get the updates to the grid, reflected on the array.- Evidently they are not getting hooked up.

the data store is defined like this :

<ext:Store ID="UsersStore" runat="server">
<ext:RecordField Name="ContactID" />
<ext:RecordField Name="AccountID" />
<ext:RecordField Name="Name" />
<ext:RecordField Name="PhoneNumber" />
<ext:RecordField Name="PhoneType" />

The gridpanel has the following definition;

<ext:GridPanel ID="UsersGrid" runat="server"
Title = "Users" StoreID="UsersStore" Height="200"
Border = "false"
Frame = "True"
StripeRows = "True"
MemoryIDField = "ContactID"
TrackMouseOver = "True"
<ColumnModel runat="server">
<ext:Column DataIndex="ContactID" ColumnID="ContactID" Hidden="true" />
<ext:Column DataIndex="Name" Header="Name">
<Editor><ext:TextField ID="TextField1" runat="server" /></Editor>
<ext:Column DataIndex="PhoneNumber" Header="Phone">
<Editor><ext:TextField ID="TextField2" runat="server" /></Editor>
<ext:Column DataIndex="PhoneType" Header="Phone Type">
<ext:ListItem Text="cell" Value="cell" />
<ext:ListItem Text="home" Value="home" />
<ext:ListItem Text="work" Value="work" />


In code behind I bind the array to the store Store and the grid..

UsersStore.DataSource = arrUsers.value



But nothing happens.. any ideas of where I'm messing it up?

Next, this way, does the gridpanel object update the array? Or just the Store? is it neccesary to make some other stuff in order the have the array with the data modified in the grid??

Thanks you guys!

Dec 16, 2009, 12:11 PM
This is sad... almost a week and no replies!

Dec 16, 2009, 12:33 PM

The information which you provided is not enought to get you an answer

1. What data do you bind (it should be array of arrays)?
2. How you try to get updates to the grid?

Provide full sample which shows how all is configured

Please post technical questions inside Help forum branch

Dec 16, 2009, 2:05 PM
Hi Vlasdch, Yes my bad. wrong forum.. sorry. (Can you move it ?)

On the specific technical data, the datasource of the grid is an arraylist of arrays.

About the updates I'm asking about, is if the data in the grid is manually modified by the user, those modifications, are reflected in the store or in the array directly ? i mean, after the user hits "continue" to submit the page, where do i find the modifications done in the grid?

Dec 17, 2009, 10:29 AM
so ?

Dec 18, 2009, 10:27 AM

Unfortunatelly the ArrayReader cannot handle ArrayList. It should be array.

where do i find the modifications done in the grid?
You have to call save for the grid and handle save request on the server side. The examples explorer has a few examples which demonstrate how to save grid data. Also you can submit grid - whole data submit but changes
Examples in Examples Explorer

- GridPanel/WebService Connections branch
- GridPanel/Miscellaneous/Submit Two Grids
- GridPanel/DataSource Update/SqlDataSource