May 26, 2020, 4:32 PM
[CLOSED] Window fails to appear
Hi Fabricio,
I have found yet another difficult issue in our migration. We have a button in a grid cell, that, when clicked is supposed to show a window with a grid if the server call returns data.
This is the code called when the button is clicked:
Incidentally, the Ext.Msg.alert("Spotlight", "No QAF Found") functionality works fine, the message appears correctly if the server returns no records.
I also tested adding a call to App.getQAFWindow().show(), and the window successfully appears, with the correct columns in the grid, but with no data.
Obviously this was working fine in EXT 2.5.3 or I wouldn't be asking the question here. I can't figure out how to troubleshoot the store's load function. Every call to ext.axd code opens yet another pane in the debugger, which I must wait to fully load before I can tell VS to Pretty Print the file. It seems to be the same file getting called over and over, I can't figure out why it wants to show another copy of the file each time.
As usual, this probably cannot be reproduced in a simple sample, and numerous other places in the application call on a window like this and it works fine.
I also tried removing IDMode="Ignore" and giving the window an explicit ID, but this made no difference.
So, I know you probably can't look at this sample and just "give me a solution," but I'm hoping that you'll be able to help with clues or debugging methods I don't yet know.
Thanks, Bob Graham
I have found yet another difficult issue in our migration. We have a button in a grid cell, that, when clicked is supposed to show a window with a grid if the server call returns data.
This is the code called when the button is clicked:
var onQAFClicked = function (column, command, record, recordIndex, cellIndex) {
var urlN = "../../api/Sales/getpricelist/" + record.data.uniq_key + "/" + App.ccustno.getValue();
Ext.Ajax.request({
url: urlN,
method: "GET",
success: function (response, opts) {
var res = Ext.JSON.decode(response.responseText);
if (res.data.length > 0) {
debugger;
var qafStore = App.getQAFWindow()
.down("grid")
.getStore();
qafStore.getProxy().url = urlN;
qafStore.load(); //We're getting to this line successfully, with good data
} else {
Ext.Msg.alert("Spotlight", "No QAF Found");
}
}
});
};
This is the declaration of the window:<ext:Window
runat="server"
IDMode="Ignore"
Title="List of Types"
Collapsible="true"
Maximizable="true"
Width="750"
Height="400"
CloseAction="Destroy"
Layout="Fit"
Plain="true"
BodyPadding="5"
ButtonAlign="Center"
TemplateWidget="true"
TemplateWidgetFnName="getQAFWindow">
<Items>
<ext:GridPanel ID="grdQAF" Header="false" runat="server" Title="QAF">
<Store>
<ext:Store
ID="storeQAF"
runat="server" AutoLoad="false">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="CustName" Type="String" />
<ext:ModelField Name="Uniq_Key" Type="String" />
<ext:ModelField Name="cCustNo" Type="String" />
<ext:ModelField Name="cPart_No" Type="String" />
<ext:ModelField Name="cRevision" Type="String" />
<ext:ModelField Name="nFUT" Type="Float" />
<ext:ModelField Name="nFromQty" Type="Float" />
<ext:ModelField Name="nICT" Type="Float" />
<ext:ModelField Name="nMatlPrice" Type="Float" />
<ext:ModelField Name="nMech" Type="Float" />
<ext:ModelField Name="nOthers" Type="Float" />
<ext:ModelField Name="nPCB_Assy" Type="Float" />
<ext:ModelField Name="nToQty" Type="Float" />
<ext:ModelField Name="nTotalPrice" Type="Float" />
<ext:ModelField Name="nZMarkup" Type="Float" />
</Fields>
</ext:Model>
</Model>
<Proxy>
<ext:RestProxy Json="true" Url="../../api/Sales/getpricelist/{0}/{1}">
<Reader>
<ext:JsonReader RootProperty="data" TotalProperty="total" />
</Reader>
</ext:RestProxy>
</Proxy>
</ext:Store>
</Store>
<Plugins>
<ext:FilterHeader runat="server" />
</Plugins>
<ColumnModel>
<Columns>
<ext:RowNumbererColumn Width="80px" runat="server" Text="QAF_NO" />
<ext:Column runat="server" Text="FROM" DataIndex="nFromQty" />
<ext:Column runat="server" Text="TO" DataIndex="nToQty" />
<ext:Column runat="server" Text="PCB_ASSEMBLY" DataIndex="nPCB_Assy" />
<ext:Column runat="server" Text="ICT" DataIndex="nICT" />
<ext:Column runat="server" Text="FUT" DataIndex="nFUT" />
<ext:Column runat="server" Text="MECHNICAL" DataIndex="nMech" />
<ext:Column runat="server" Text="OTHERS" DataIndex="nOthers" />
<ext:Column runat="server" Text="MARKUP" DataIndex="nZMarkup" />
<ext:Column runat="server" Text="MATERIAL" DataIndex="nMatlPrice" />
<ext:Column runat="server" Text="TOTAL_PRICE" DataIndex="nTotalPrice" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel Mode="Single" runat="server" />
</SelectionModel>
</ext:GridPanel>
</Items>
</ext:Window>
The window is successfully instantiated, and the code successfully calls the load function on the store, but fails to appear. The code jumps deeply into ext.axd functionality that I cannot follow. The Model in the store did not originally have a member for every value returned from the server call, so I added the missing ones. Incidentally, the Ext.Msg.alert("Spotlight", "No QAF Found") functionality works fine, the message appears correctly if the server returns no records.
I also tested adding a call to App.getQAFWindow().show(), and the window successfully appears, with the correct columns in the grid, but with no data.
Obviously this was working fine in EXT 2.5.3 or I wouldn't be asking the question here. I can't figure out how to troubleshoot the store's load function. Every call to ext.axd code opens yet another pane in the debugger, which I must wait to fully load before I can tell VS to Pretty Print the file. It seems to be the same file getting called over and over, I can't figure out why it wants to show another copy of the file each time.
As usual, this probably cannot be reproduced in a simple sample, and numerous other places in the application call on a window like this and it works fine.
I also tried removing IDMode="Ignore" and giving the window an explicit ID, but this made no difference.
So, I know you probably can't look at this sample and just "give me a solution," but I'm hoping that you'll be able to help with clues or debugging methods I don't yet know.
Thanks, Bob Graham
Last edited by fabricio.murta; Jun 01, 2020 at 1:14 PM.