View Full Version : [CLOSED] Gridpanel: send selected data to server

Mar 08, 2013, 2:24 PM
I noted that when select data from the a gridpanel store are sent to server via extraparams

Ext.encode(#{GridPanel1}.getRowsValues({selectedOn ly : true}))

and following selection model

<ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" AllowDeselect="true" runat="server"
<BeforeSelect Handler="enButtonG1(#{GridPanel1});" />
<BeforeDeselect Handler="disButtonG1(#{GridPanel1});" />

if pagingtoolbar on the grid is enabled and some sorting on some columns is done before sending data, the resulting array to the server
doesn't contain the expected rows ..

I guess this problem has just been experienced by someone else, anyway, can you tell me what is the right way to send to server the complete array of selected rows in the gridpanel even when pagintoolbar is used

Thanks in advance

<ext:Button ID="btnSaveToDB" runat="server" Text="Save data" ToolTip="Save data loaded to DB"
<Click OnEvent="sendDataToDB" After="enableFields();">
<EventMask ShowMask="true" Target="CustomTarget" CustomTarget="Viewport1" />
<ext:Parameter Name="Grid1" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOn ly : true}))"
Mode="Raw" />
<ext:Parameter Name="Grid2" Value="Ext.encode(#{GridPanel2}.getRowsValues({selectedOn ly : true}))"
Mode="Raw" />

Mar 08, 2013, 4:28 PM
Hi @tanky65,

Are you using remote or local paging?

Mar 09, 2013, 7:34 AM
Hi @tanky65,

Are you using remote or local paging?

i'm using local paging

Daniil, I understood the behaviour and why i was getting a row different from the one i selected:

in my application I can select one or more rows on the gridpanel and so i prefer to use checkboxpanel set on multiselect.
Image I have 100 rows paged for 10 rows per set
for the behaviour of the selectionmodel, if you select the checkbox on one row you mark that record, than you can add more selected rows with the same action,
if you click on the row (not on the checkbox) the rows previously selected are deselected but only on the subset of the shown rows (current 10 rows).

So, when I click on the row (not on the checkbox) I would leave selected only the current row on the entire set of the grid, (user could forget some selected rows on the other set of the paged rows)

furthermore, when i click on the select/deselect all checkbox I would the action apply on all rows of the set and of on those of the current page
is it possible?

thanks in advance

Mar 10, 2013, 9:30 AM
I can compact what said above with the following

referencing to following example


the action of the chekbox [select/deselect all] is limited to the rows of the current page. if deselect all on the current page, selected rows on the othe pages remain selected.

is there a way to make the select/deselect action on all items of the buffer?



Mar 11, 2013, 8:44 AM
Yes, that Checkbox deals with a current page only.

I would try to override the CheckboxSelectionModel's onHeaderClick method.

This example should help to override.

Mar 13, 2013, 9:49 PM
Thanks to clarify. you can close it