English 中文(简体)
JsonStore沉积于<i>随机<i>。
原标题:JsonStore throws loadexception <i>at random</i>

我有以下问题:我有数据。 JsonStore住了一个 com子。 装载量除外:有时。 我可以及时更新 com子,但更早或更晚,我会例外。 因此,为了检查时间问题,我增加了服务器上的拖延,现在我总是例外。 该法典:

JsonStore:

var ticketStore = new Ext.data.JsonStore({
    url: /Hour/ListTickets ,
    autodestroy:true,
    totalProperty: records ,
    idProperty: Id ,
    root: rows ,
    fields:[{name: Id },{name: Titel }]
});
ticketStore.on({ loadexception :{fn:storeLoadException,scope:this}});

The ComboBox:

var ticketCombo = new Ext.form.ComboBox(
            {
                fieldLabel: Ticket ,
                hiddenName: TicketId ,
                store:ticketStore,
                width:300,
                valueField: Id ,
                minChars:2,
                displayField: Titel ,
                typeAhead:false,
                forceSelection:true,
                pageSize:25,
                triggerAction: all ,
                emptyText: Selecteer een waarde... ,
                selectOnFocus:true,
                valueNotFoundText:"nitchevo",
                value:1567,
                allowBlank: false
            }
        );

数据:

    try
    {
        IList<Dictionary<string, object>> returnValue = new List<Dictionary<string, object>>();

        returnValue.Add(new Dictionary<string, object>{ {"Id", 1}, {"Titel", "IkBenTitel"}});
        System.Threading.Thread.Sleep(7500);

        return returnValue;

    }
    catch (Exception e)
    {
        Console.WriteLine(e);
    }

从数据改为Json

public static JsonResult JSon(this IList<Dictionary<string, object>> list)
{
    var jsonData = new
    {
        records = list.Count,
        rows = list.ToArray()
    };
    JsonResult json = JsonHelper.Json(jsonData);
    return json;
}

根据Fiddler提供的Json-数据

{"records":1,"rows":[{"Id":1,"Titel":"IkBenTitel"}]}

现在,由于7.5秒的推测,当数据本应到达客户时,我会有一个例外的客户。 毫不拖延地,我随机例外。 例外见Json数据,但我得到的唯一描述是Syntax错误,这种错误无帮助。

除了表格和存储/储存箱外,我已经删除了所有页。 你们看到我提供了模拟数据,因此数据库甚至无法查阅。 它使我 driving!

我真的赞赏任何帮助,我早就在工作了3天。 为记录起见,我使用因特网探索者版本8.0.7600.16385,但也出现在 Ch。

Update The bug doesn t show up in Firefox so I can t use console.

A few params from the exception
limit: 25
query: ""
start: 0
reader.ef.length: 2
jsonData.rows[0].Id: 1
jsonData.rows[0].Titel: "IkBentitel"
reader.meta.fields[0].name: "Id"
reader.meta.fields[1].name: "Titel"
reader.meta.idProperty: "Id"
reader.meta.totalProperty: "records"
reader.meta.url "/Hour/ListTickets"

如果需要追加资源,请让我知道。 我也给例外的手稿增加了动力,情况是200个。 它使我越来越感到迷惑......

问题回答

而不是捕获<代码> 载荷除外,而是从储存中捕获更为通用的<代码>除外

ticketStore.on( exception , function(proxy, type, action, options, response, args) {
    console.log(proxy, type, action, options, response, args);
});

关于<代码>除外的细节 http://dev.sencha.com/deploy/ext-3.3.1/docs/?class=Ext.data.DataProxy”rel=“nofollow” 数据发布活动:。

EDIT: I put the wrong arguments in my code sample, sorry!

Check the type parameter of the exception event. It s a string and my guess is that its value is remote - meaning you got a valid HTTP response ( code 200, like you said ), but the reader has determined that it contains an error from the server. Try adding in "success": true to your JSON response and see if that solves it.

如果<条码> 类型值为response,以及您的《吉祥港规则》答复为400或500,则读者确定,答复与所寻求的格式(例如,没有<条码>查询<<>>>>>或<条码>)相符。





相关问题
WPF Datagrid, Setting the background of combox popup

I would like to change the color of the popup background when using a DatagridComboboxColumn in the WPF Toolkit datagrid. I ve edited the Template for a normal Combobox and it works great for selected ...

How to insert ComboBox item into ListBox? [winforms]

The question is very simple, How to insert ComboBox selected item into ListBox using c#? I have tried with this: listbox.Items.Add(combobox.SelectedItem); and some other permutations but it always ...

How do I bind a ComboBox to a one column list

I ve seen how to bind a ComboBox to a list that has columns like this: ItemsSource="{Binding Path=Entries}" DisplayMemberPath="Name" SelectedValuePath="Name" SelectedValue="{Binding Path=Entry}" But ...

Wpf Combobox Limit to List

We are using Wpf Combobox to allow the user to do the following things: 1) select items by typing in the first few characters 2) auto complete the entry by filtering the list 3) suggesting the first ...

热门标签