tags:

views:

439

answers:

2
var remoteLookupJsonStore = new Ext.data.JsonStore({
root : 'records',
baseParams : {
  column : 'fullName'
},
fields : [
{
  name : 'name',
  mapping : 'fullName'
},
{
  name : 'id',
  mapping : 'id'
}
],
proxy : new Ext.data.ScriptTagProxy({
    url : 'LookupLoader.ashx'
     //url: 'http://tdg-i.com/dataQuery.php' similar data
})
});

var combo2 = {
xtype : 'combo',
fieldLabel : 'Search by name',
forceSelection : true,
displayField : 'name',
valueField : 'id',
hiddenName : 'customerId',
loadingText : 'Querying....',
minChars : 1,
triggerAction : 'name',
store : remoteLookupJsonStore
};

This sample works with the original data store 'http://tdg-i.com/dataQuery.php'. My ashx handler returns data in the same format, but the data is different. Anyhow, when I use my ashx handler, the handler gets invoked, it returns data, but combo always stays in the loading state, and never displays the data. I am assuming that the problem is with the data I am returning, but its format is fine,the last thing I changed was setting the Content Type

context.Response.ContentType = "application/json";

but I still cannot get this thing to work, any suggestions?

this is data coming from my handler.

({"totalCount": "4","records":[{"id":1,"fullName": "aaa bbb"},{"id":2,"fullName":"cc dd"},{"id":3,"fullName":"ee ff"},{"id":4,"fullName":"gg hh"}]});

A: 

Your first record (id 1) is missing "fullName" which makes it invalid JSON -- not sure if that's just an error typing it here or not.

bmoeskau
my bad, its copy paste error, I was trying to modify the sample data!
hazimdikenli
A: 
proxy : new Ext.data.ScriptTagProxy({
    url : 'LookupLoader.ashx'
     //url: 'http://tdg-i.com/dataQuery.php' similar data
})

well looks like for querying same domain, I should be using HttpProxy

so there you have it, that is why it was working with the sample data provided by the web site but not with my local version.

hazimdikenli