Jan 21, 2015, 9:03 AM
[CLOSED] Show Button ONLY in certain case... but in GridPanel
I need to show a Column in a Gridpanel that shows a TextField in cells that shows a Button only in certain case... only if I press the "1" button.
In single Form the code run correctly... look here:
http://forums.ext.net/showthread.php...-certains-case
But... if I make the code for GridPanel Column, it not works.
Also the layout and the auto width (flex = 1) not works.
Can you help me?
The code:
In single Form the code run correctly... look here:
http://forums.ext.net/showthread.php...-certains-case
But... if I make the code for GridPanel Column, it not works.
Also the layout and the auto width (flex = 1) not works.
Can you help me?
The code:
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = new object[]
{
new object[] { 1, "1" },
new object[] { 2, "2" },
new object[] { 3, "3" }
};
this.Store1.DataBind();
}
}
</script>
<script type="text/javascript">
var keyFn = function (el, e) {
if (e.button == '48') {
App.ButtonTest.show();
}
else {
App.ButtonTest.hide();
}
return false;
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" ID="ResourceManager1" />
<ext:GridPanel runat="server" ID="GridPanel1" Width="300">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model runat="server" ID="Model1">
<Fields>
<ext:ModelField Name="ID" Type="Int" />
<ext:ModelField Name="Name" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server" ID="ColumnModel1">
<Columns>
<ext:Column runat="server" Text="Groups" >
<Columns>
<ext:Column runat="server" DataIndex="ID" Width="50" Text="ID" />
<ext:ComponentColumn runat="server" DataIndex="Name" Flex="1" Text="Name">
<Component>
<ext:TextField runat="server" EnableKeyEvents="true" >
<Listeners>
<KeyPress Fn="keyFn" />
</Listeners>
<RightButtons>
<ext:Button ID="ButtonTest" runat="server" Icon="Add" Hidden="true" />
</RightButtons>
</ext:TextField>
</Component>
</ext:ComponentColumn>
</Columns>
</ext:Column>
</Columns>
</ColumnModel>
</ext:GridPanel>
</form>
</body>
</html>
Last edited by Daniil; Jan 23, 2015 at 1:54 PM.
Reason: [CLOSED]