Jun 18, 2017, 3:23 AM
[CLOSED] JS Error on "smart search"
Support,
found in: 4.2.1
The problem is that if you search again in some case, it causes a JS error. the problem in PROD is that this causes ALL the searches to stop working and we need to reload the page to fix it.
Steps:
1. load screen
2. type "test" (no quotes) into the combobox,
- it will search the controller and return whole bunch of results
3. when the dropdown shows, hit ESC (dropdown will disappear)
4. now click the "down arrow" trigger of the combobox and you get a JS error
thanks
/Z
aspx
found in: 4.2.1
The problem is that if you search again in some case, it causes a JS error. the problem in PROD is that this causes ALL the searches to stop working and we need to reload the page to fix it.
Steps:
1. load screen
2. type "test" (no quotes) into the combobox,
- it will search the controller and return whole bunch of results
3. when the dropdown shows, hit ESC (dropdown will disappear)
4. now click the "down arrow" trigger of the combobox and you get a JS error
thanks
/Z
aspx
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Search </title>
</head>
<body>
<form id="Testsetset" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
<Items>
<ext:FormPanel
ID="blah"
runat="server"
Title="Search"
AutoWidth="true"
AutoScroll="true"
Height="200"
BodyPadding="3"
CollapseMode="Default"
Collapsible="true"
Icon="ClockGo"
>
<Items>
<ext:ComboBox ID="ComboBoxTestCC1"
runat="server"
Padding="5"
DisplayField="description"
TypeAhead="false"
ValueField="id"
EmptyText="Select an item"
PageSize="10"
Width="300"
FieldLabel="Cost Center 1"
MinChars="1" >
<Store>
<ext:Store ID="StoreTestCC1" runat="server" AutoLoad="false">
<Proxy>
<ext:AjaxProxy Url="/ta/Support/GetData3">
<ActionMethods READ="GET" />
<Reader>
<ext:JsonReader IDProperty="id" RootProperty="data" TotalProperty="total"/>
</Reader>
</ext:AjaxProxy>
</Proxy>
<Model>
<ext:Model ID="Model2" IDProperty="id" runat="server">
<Fields>
<ext:ModelField Name="id" Type="Int" />
<ext:ModelField Name="description" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<Triggers>
<ext:FieldTrigger Icon="Clear" Hidden="true" />
</Triggers>
<Listeners>
<Select Handler="if (this.editable) { this.getTrigger(0).show(); } " />
<BeforeQuery Handler="this.getTrigger(0)[ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
<TriggerClick Handler="if (index == 0) { this.clearValue(); this.getTrigger(0).hide(); }" />
</Listeners>
<ListConfig LoadingText="Loading..." ItemSelector="div.search-item">
<ItemTpl ID="ItemTpl1" runat="server">
<Html>
<tpl for=".">
<div class="search-item">
<h3>{id}</h3>Description: {description}
</div>
</tpl>
</Html>
</ItemTpl>
</ListConfig>
</ext:ComboBox>
</Items>
</ext:FormPanel>
</Items>
</ext:Viewport>
</form>
</body>
</html>
controller public ActionResult GetData3(int? start, int? limit, string sort, string dir)
{
List<TestData3> l = new List<TestData3>();
for (int i = 0; i < 245; i++)
{
TestData3 t = new TestData3();
t.id = i;
t.description = "test_" + i;
l.Add(t);
}
var query = l.Select(dt => new
{
id = dt.id,
description = dt.description
}).OrderBy(d => d.id);
return this.Store(query.Skip(start.HasValue ? start.Value : 0).Take(limit.HasValue ? limit.Value : 500), query.Count());
}
class public class TestData3
{
public long id;
public string description;
}
Last edited by fabricio.murta; Jun 26, 2017 at 2:24 PM.