Sep 19, 2012, 12:47 PM
[OPEN] [#130] RadioGroup SetValue
Hi,
Related with this thread http://forums.ext.net/showthread.php?14644 I adapted it to v2.1 but it doesn't works and doesn't check any radiobutton.
Related with this thread http://forums.ext.net/showthread.php?14644 I adapted it to v2.1 but it doesn't works and doesn't check any radiobutton.
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[] {
new object[] { "0" },
new object[] { "1" },
new object[] { "2" }
};
store.DataBind();
}
}</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.Net Example</title>
<script type="text/javascript">
var commandHandler = function (column, command, record, rowIndex, colIndex) {
switch (command) {
case "edit":
var cell = GridPanel1.getView().getCell(record, column);
Window1.rowIndex = rowIndex;
Window1.show();
Window1.getEl().alignTo(cell);
RadioGroup1.setValue(record.get('test'));
}
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="test" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Test" DataIndex="test">
<Commands>
<ext:ImageCommand CommandName="edit" Icon="TableEdit" />
</Commands>
<Listeners>
<Command Fn="commandHandler" />
</Listeners>
</ext:Column>
</Columns>
</ColumnModel>
</ext:GridPanel>
<ext:Window ID="Window1" runat="server" Title="Edit" Hidden="true">
<Items>
<ext:RadioGroup ID="RadioGroup1" runat="server" ColumnsNumber="1">
<Items>
<ext:Radio runat="server" BoxLabel="0" InputValue="0" />
<ext:Radio runat="server" BoxLabel="1" InputValue="1" />
<ext:Radio runat="server" BoxLabel="2" InputValue="2" />
</Items>
</ext:RadioGroup>
</Items>
<Listeners>
<Hide Handler="GridPanel1.getStore().getAt(this.rowIndex).set('test', RadioGroup1.getValue().inputValue);" />
</Listeners>
</ext:Window>
</form>
</body>
</html>
What I have to pass to setValue method?
Last edited by Daniil; Jan 18, 2013 at 11:07 AM.
Reason: [OPEN] [#130]