balakk
10 May 2007, 2:57 PM
I can't seem to find the problem, I am getting a response pluse the loading text and my JSON format seems to be correct it is a large set so i won't post it but here is my code I have a div with the id="member-searches" ?
var tpl = new Ext.Template(
'<a href="{search_id}">{search_name}</a> <br />'
);
var moreView = new Ext.JsonView("member-searches", tpl, {
jsonRoot: "data"
});
moreView.load({
url:"/admin/ajax.php",
params:{member_id:5,ajaxFrm: 'memberSearches'} ,
text:"Loading Searches..."
});
jsakalos
10 May 2007, 3:01 PM
Just hints:
Code enclosed in Ext.onReady() ?
Firebug throws some errors?
balakk
10 May 2007, 3:06 PM
Yes in Ext.OnReady no FB errors
jsakalos
10 May 2007, 3:09 PM
Hmm :-|,
if data is coming from server and if root is really good then I would trace through code (include ext-all-debug.js) to find out where data get lost.
Meanwhile, can you post a fragment of server's response starting from beginning?
balakk
10 May 2007, 3:18 PM
The response:
{
'totalrows': 1,
'data': [
{
'search_id' : '11',
'member_id' : '5',
'search_name' : 'Another Search',
'search_param_list' : 'zip=97015^price_max=450000',
'listing_id_results' : '7013222,6103926,7026322,6103920,7034187,7029110,6103930,7035425,7006565,7038633
,7008019,6103928,7040644,7026303,6103927,7038593,6097380,7039635,7032199,7011025,7035255,7039149,7043122
,6086284,7015592,7040678,7037927,7038801,7039818,6096764,7039581,7022536,7014013,7017113,7033092,7025586
,7034703,7025699,7034785,7038212,7035902,7038613,6102321,7041925,7005568,7033802,7039017,7026311,7034202
,7001447,7043393,6107010,7038376,7009989,7030161,7023736,7011513,7032936,7027995,7038564,7042298,7011608
,7029811,7020183,7032274,7019998,7030457,7043523,7035267,7027015,7001901,7010740,7038775,7005979,7013050
,7015814,7016997,7025643,7010437,7039520,7012680,7026483,7022201,7019044,7038262,7038555,7043555,7012628
,6102262,7037338,7004115,7033842,7033947,7024539,7042151,7022487,7036968,7010247,7028558,7032038,7033166
,7037282,7018540,7033190,7017738,7034656,5046334,7008702,7028531,7028618,7018570,7028565,7027341,7037302
,7037961,7003127,7032614,7014432,7027568,7017610',
'last_added_listing_ids' : '7043555',
'last_update_dttm' : '2007-05-10 13:20:03'
}
]
};
I included the debug but I'm not sure how that works
jsakalos
10 May 2007, 3:35 PM
Hmm, this is my fragment and it works. My root is "records":
{"totalCount":"8","records":[{"persID":"2","persTitle":null,"persFirstName":"Ardal\u00e1\u0161asdfa","persLastName":"Szab\u00f3","persTitle2":null,"persGender":"0","persFullName":"Ardal\u00e1\u0161 Szab\u00f3","persNote":null},{"persID":"6",.....
The only difference I can see at the first glance is that your json is single quoted but I have no clue if this can make difference.
I have no other idea but tracing the code. Maybe somebody else knows better.
Anyway, Good luck!
balakk
10 May 2007, 3:51 PM
Ok Thanks I'll try to change the quotes
balakk
10 May 2007, 4:13 PM
Hmm don't think it was the quotes. I uses the same encode on my data grid that works fine ?
balakk
11 May 2007, 6:05 AM
Ok I setup a test page:
http://webversatile.com/admin/extapp.php
can't seem to get this to work
jsakalos
11 May 2007, 6:11 AM
Try to add success:true to the returned json.
jsakalos
11 May 2007, 6:17 AM
:-/ There is something what I would't expect in your test page:
When I click add the whole page is reloaded. I would expect that only searches get loaded. I don't know, maybe this behavior is intentional.
The ideal scene with Ext should IMHO be: Load only first time. Then send/receive everything in background.
balakk
11 May 2007, 6:20 AM
I did no change, did I add it to the write place ?
jsakalos
11 May 2007, 6:22 AM
It's not correct:
It's "success":"true" that means true is string. I guess that test is (o.success === true) so you have to return "success":true
The trailing } is missingI cannot tell if this is really reason of items not appearing but the response should be corrected anyway.
balakk
11 May 2007, 6:23 AM
NOt sure I know what you mean nothing should be reloading I'm not seeing that behavior
balakk
11 May 2007, 6:25 AM
You are the man that was it , success : true thanks soo much !!!.
jsakalos
11 May 2007, 6:29 AM
If I watch firebug's console and I click add I see XHR request. Then I click add again console gets cleared and I see ONE request again.
My page operations give something like this:
jsakalos
11 May 2007, 6:36 AM
You can see that "add" is ordinary link which means browser goes to the page pointed to by that link.
Consider using button instead with handler to get data for view in background.
balakk
11 May 2007, 7:46 AM
I will thanks, this was more of a test then design :)
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.