Jun 07, 2012, 2:07 PM
[CLOSED] Pre-Selecting gridpanel checkbox nodes..
Hi,
I have a gridpanel on a page that is used to display the roles a user is attached to. I load the roles from Json set in the controller:
I have a gridpanel on a page that is used to display the roles a user is attached to. I load the roles from Json set in the controller:
if (ViewBag.Roles != null)
RolesStore.SetDataFromJson(ViewBag.Roles.ToString());
What I want to do now is to select the rows that the user is attached to when the page opens. Is there a simple way to do this, perhaps something I can set on the json object? My grid panel and store are below. Thanks <ext:Store runat="server" ID="RolesStore" AutoLoad="false">
<Reader>
<ext:JsonReader IDProperty="RoleId">
<Fields>
<ext:RecordField Name="RoleId" />
<ext:RecordField Name="Name" />
<ext:RecordField Name="Description" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:GridPanel
ID="RolesList"
runat="server"
StoreID="RolesStore"
StripeRows="true"
AutoExpandColumn="Description">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnId="Name" Header="Profile" Width="160" DataIndex="Name" Resizable="true" MenuDisabled="true" Fixed="true" />
<ext:Column ColumnId="Description" Header="Description" DataIndex="Description" Resizable="true" MenuDisabled="true" Fixed="true" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
</SelectionModel>
</ext:GridPanel>
Last edited by Daniil; Jun 12, 2012 at 9:51 AM.
Reason: [CLOSED]