Feb 15, 2011, 8:07 PM
[CLOSED] Problem with GridPanel controls and FileUploadField controls in the same page
Hi,
i've basically the same problem like here:
http://forums.ext.net/showthread.php...oadField+proxy
The DirectMethods are empty, only occurs with Proxy and GridPanel in same Form
i've basically the same problem like here:
http://forums.ext.net/showthread.php...oadField+proxy
The DirectMethods are empty, only occurs with Proxy and GridPanel in same Form
<!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></title>
<ext:XScript ID="XScript1" runat="server">
<script type="text/javascript">
function searchText(text) {
Store2.clearFilter();
var re = new RegExp(".*" + text + ".*", "i");
Store2.filterBy(function (node) {
return re.test(node.data.NAME);
});
}
var filterTree2 = function (el, e) {
var text = this.getRawValue();
Store1.clearFilter();
if (Ext.isEmpty(text, false)) {
return;
}
if (e.getKey() === Ext.EventObject.ESC) {
clearFilter2();
} else {
Store1.clearFilter();
var re = new RegExp(".*" + text + ".*", "i");
Store1.filterBy(function (node) {
return re.test(node.data.NAME);
});
}
};
var filterTree = function (el, e) {
var text = this.getRawValue();
//Store1.clearFilter();
if (Ext.isEmpty(text, false)) {
return;
}
if (e.getKey() === Ext.EventObject.ESC) {
clearFilter();
} else {
searchText(text);
}
};
var clearFilter = function () {
TriggerField1.setValue("");
Store2.clearFilter();
};
var clearFilter2 = function () {
TriggerField2.setValue("");
Store1.clearFilter();
};
var search = function (grid, rowIndex, columnIndex, e) {
/*
var rec = GridPanel1.getStore().getAt(rowIndex);
text = rec.data.NAME.toLowerCase().substr(0, 5);
TriggerField1.setValue(text);
searchText(text);
*/
}
var trailer = function () {
var rec = GridPanel2.getSelectionModel().getSelected().data;
Window6.load("player.aspx?EAN=" + rec.EAN);
Window6.setTitle(rec.NAME);
Window6.show();
}
var trailer2 = function () {
var rec = GridPanel3.getSelectionModel().getSelected().data;
Window6.load("player.aspx?EAN=" + rec.EAN);
Window6.setTitle(rec.NAME);
Window6.show();
}
</script>
</ext:XScript>
</head>
<body>
<form id="Form1" runat="server" onsubmit="return false;">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<table>
<tr>
<td>
<ext:GridPanel ID="GridPanel1" runat="server" StripeRows="true" TrackMouseOver="true"
Width="600" Height="300" AutoExpandColumn="NAME">
<Store>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:JsonReader IDProperty="EAN">
<Fields>
<ext:RecordField Name="NAME" />
<ext:RecordField Name="EAN" />
<ext:RecordField Name="CODE" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnID="NAME" Header="Movie" Width="160" DataIndex="NAME" />
<ext:Column ColumnID="EAN" Header="EAN" Width="160" DataIndex="EAN" />
<ext:Column ColumnID="CODE" Header="Code" Width="160" DataIndex="CODE" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
<Listeners>
</Listeners>
</ext:RowSelectionModel>
</SelectionModel>
<TopBar>
<ext:Toolbar ID="Toolbar2" runat="server">
<Items>
<ext:ToolbarTextItem ID="ToolbarTextItem2" runat="server" Text="Filter:" />
<ext:ToolbarSpacer />
<ext:TriggerField ID="TriggerField2" runat="server" EnableKeyEvents="true">
<Triggers>
<ext:FieldTrigger Icon="Clear" />
</Triggers>
<Listeners>
<KeyUp Fn="filterTree2" Buffer="250" />
<TriggerClick Handler="clearFilter2();" />
</Listeners>
</ext:TriggerField>
</Items>
</ext:Toolbar>
</TopBar>
<Listeners>
<CellClick Fn="search" />
</Listeners>
</ext:GridPanel>
<ext:GridPanel ID="GridPanel2" runat="server" StripeRows="true" TrackMouseOver="true"
Width="600" Height="300" AutoExpandColumn="NAME">
<Store>
<ext:Store ID="Store2" runat="server">
<Reader>
<ext:JsonReader IDProperty="EAN">
<Fields>
<ext:RecordField Name="NAME" />
<ext:RecordField Name="EAN" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel2" runat="server">
<Columns>
<ext:Column ColumnID="NAME" Header="Movie" Width="160" DataIndex="NAME" />
<ext:Column ColumnID="EAN" Header="EAN" Width="160" DataIndex="EAN" />
</Columns>
</ColumnModel>
<Listeners>
<CellDblClick Fn="trailer" />
</Listeners>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel2" runat="server" SingleSelect="true" />
</SelectionModel>
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="Filter:" />
<ext:ToolbarSpacer />
<ext:TriggerField ID="TriggerField1" runat="server" EnableKeyEvents="true">
<Triggers>
<ext:FieldTrigger Icon="Clear" />
</Triggers>
<Listeners>
<KeyUp Fn="filterTree" Buffer="250" />
<TriggerClick Handler="clearFilter();" />
</Listeners>
</ext:TriggerField>
</Items>
</ext:Toolbar>
</TopBar>
</ext:GridPanel>
</td>
<td valign="top">
<ext:GridPanel ID="GridPanel3" runat="server" StripeRows="true" TrackMouseOver="true"
Width="600" Height="300" AutoExpandColumn="NAME" Title="Linked Trailer">
<Store>
<ext:Store ID="Store3" runat="server" OnRefreshData="Store3_Refresh">
<Reader>
<ext:JsonReader IDProperty="ID">
<Fields>
<ext:RecordField Name="ID" />
<ext:RecordField Name="EAN" />
<ext:RecordField Name="CODE" />
<ext:RecordField Name="NAME" />
</Fields>
</ext:JsonReader>
</Reader>
<Proxy>
<ext:PageProxy>
</ext:PageProxy>
</Proxy>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column ColumnID="CODE" DataIndex="CODE" Header="Code" />
<ext:Column ColumnID="NAME" DataIndex="NAME" Header="Movie" />
<ext:Column ColumnID="EAN" DataIndex="EAN" Header="EAN" />
</Columns>
</ColumnModel>
<LoadMask ShowMask="true" />
<SelectionModel>
<ext:RowSelectionModel runat="server" SingleSelect="true" />
</SelectionModel>
<Listeners>
<CellDblClick Fn="trailer2" />
</Listeners>
</ext:GridPanel>
<div style="padding: 15px">
<ext:Button Text="Link Movies" ID="btnLink" runat="server">
<DirectEvents>
<Click OnEvent="LinkMovies">
</Click>
</DirectEvents>
</ext:Button>
<br />
<ext:Button ID="Button4" runat="server" Text="Remove Link">
<DirectEvents>
<Click OnEvent="RemoveMovie">
<ExtraParams>
<ext:Parameter Name="ID" Value="GridPanel3.getSelectionModel().getSelected().data.ID"
Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
<br />
<ext:FormPanel ID="BasicForm" runat="server" Width="500" Frame="true" Title="File Upload Form"
AutoHeight="true" MonitorValid="true" PaddingSummary="10px 10px 0 10px" LabelWidth="50">
<Defaults>
<ext:Parameter Name="anchor" Value="95%" Mode="Value" />
<ext:Parameter Name="allowBlank" Value="false" Mode="Raw" />
<ext:Parameter Name="msgTarget" Value="side" Mode="Value" />
</Defaults>
<Items>
<ext:TextField ID="PhotoName" runat="server" FieldLabel="Name" />
<ext:FileUploadField ID="FileUploadField1" runat="server" EmptyText="Select an image"
FieldLabel="Photo" ButtonText="" Icon="ImageAdd" />
</Items>
<Listeners>
<ClientValidation Handler="#{SaveButton}.setDisabled(!valid);" />
</Listeners>
<Buttons>
<ext:Button ID="SaveButton" runat="server" Text="Save">
<DirectEvents>
<Click IsUpload="true" OnEvent="UploadClick" Before="if (!#{BasicForm}.getForm().isValid()) { return false; }
Ext.Msg.wait('Uploading your photo...', 'Uploading');" Failure="Ext.Msg.show({
title : 'Error',
msg : 'Error during uploading',
minWidth: 200,
modal : true,
icon : Ext.Msg.ERROR,
buttons : Ext.Msg.OK
});">
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="Button1" runat="server" Text="Reset">
<Listeners>
<Click Handler="#{BasicForm}.getForm().reset();" />
</Listeners>
</ext:Button>
</Buttons>
</ext:FormPanel>
</div>
</td>
</tr>
</table>
</form>
<ext:Window ID="Window6" runat="server" Hidden="true" X="10" Y="10" Width="505" Height="405">
<AutoLoad Mode="IFrame">
</AutoLoad>
</ext:Window>
</body>
</html>
Last edited by Daniil; Feb 18, 2011 at 8:43 AM.
Reason: [CLOSED]