PDA

View Full Version : layout browser and loading url



zamkinos
2 Mar 2010, 12:44 AM
hi i'm modifiying layout browser example. when i click an item on left tree panel i'm running the code below.
Ext.getCmp('content-panel').load(n.attributes.divAdi + '.aspx');
i've an aspx page with dynamically loading grid in it.
http://www.extjs.com/deploy/dev/examples/grid/paging.html (with httpproxy)
if i run this page alone it works ok. but when i click it from left tree panel, the grid is not loading. "loading from httpproxy event" is not triggering. no error is appearing in firebug. where is my fault?

regards.

fay
2 Mar 2010, 1:58 AM
where is my fault?

It's impossible to say without seeing your code + aspx page. Post a working showcase (http://www.extjs.com/learn/Ext_Forum_Help#Posting_a_working_showcase), and please just the minimum that's needed to reproduce the problem.

Before that check the documentation for load() and look at the parameters it can take:


panel.load({
url: 'your-url.php',
params: {param1: 'foo', param2: 'bar'}, // or a URL encoded string
callback: yourFunction,
scope: yourObject, // optional scope for the callback
discardUrl: false,
nocache: false,
text: 'Loading...',
timeout: 30,
scripts: false
});

It's likely that you need to set scripts to true.

zamkinos
2 Mar 2010, 1:11 PM
my pages are below.

Default.aspx

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Ana Sayfa</title>
<link rel="shortcut icon" href="resimLer/ZLogoFav.gif"/>
<!-- ** CSS ** -->
<!-- base library -->
<link rel="stylesheet" type="text/css" href="cssLer/ext-all.css" />
<!-- overrides to base library -->
<link rel="stylesheet" type="text/css" href="cssLer/CenterLayout.css" />
<!-- page specific -->
<link rel="stylesheet" type="text/css" href="cssLer/layout-browser.css" />
<link rel="stylesheet" type="text/css" href="cssLer/xtheme-gray.css" />
</head>
<body>

<!-- Loading mask and image -->
<div id="loading-mask" style=""></div>
<div id="loading">
<div class="loading-indicator"><img alt="Yukleniyor..." src="resimLer/extanim32.gif" width="32" height="32" style="margin-right:8px;" align="absmiddle"/>Yükleniyor...</div>
</div>

<!-- ** Javascript ** -->
<!-- ExtJS library: base/adapter -->
<script type="text/javascript" src="jsLer/ext-base-debug.js"></script>
<script type="text/javascript" src="jsLer/ext-all-debug.js"></script>
<!-- gerekli javascriptler -->
<script type="text/javascript" src="jsLer/GenelIslemler.js"></script>
<!-- page specific -->
<script type="text/javascript" src="jsLer/layout-browser.js"></script>

<form id="frmAnaSayfa" runat="server">
<div id="header"><h1 onclick="javascript:window.location='Default.aspx';" title="Ana Sayfa" style="cursor:pointer;">|&nbsp;www.zamkinos.net&nbsp;|</h1></div>
<div style="display:none;">

<!-- Start page content -->
<div id="divAnaSayfa" runat="server" style="padding:15px 15px 15px 15px;">
&nbsp;ana sayfa
</div>
<div id="divGuney">
<table cellpadding="0px" cellspacing="0px" id="tblReklamlar" style="text-align:center; margin-left:auto; margin-right:auto;">
<tr>
<td>
[ <a href="Default.aspx">Ana&nbsp;Sayfa</a> ]&nbsp;|
[ <a href="javascript:adreseGit('DersNotlari.aspx');">Ders&nbsp;Notlar?</a> ]&nbsp;|
[ <a href="javascript:adreseGit('Yazilim.aspx');">Yaz?l?m</a> ]&nbsp;|
[ <a href="javascript:adreseGit('Programlar.aspx');">Programlar</a> ]&nbsp;|
[ <a href="javascript:adreseGit('KomikYazilar.aspx');">E?lence</a> ]&nbsp;|
[ <a href="javascript:adreseGit('ZiyaretciDefteri.aspx');">Ziyaretçi&nbsp;Defteri</a> ]&nbsp;|
[ <a href="mailto:[email protected]?subject=Sayfa_Hakkinda">E-Posta</a> ]&nbsp;|&nbsp;&nbsp;&nbsp;&copy;&nbsp;2010&nbsp;ZAMKiNOS&nbsp;&nbsp;&nbsp;
</td>
</tr>
</table>
</div>
</div>
</form>
</body>
</html>



Makaleler.aspx

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Paging Grid Example</title>

<link rel="stylesheet" type="text/css" href="cssLer/ext-all.css" />
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script><script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-1396058-1"); pageTracker._initData(); pageTracker._trackPageview(); } catch (err) { }
</script>
<!-- LIBS -->
<script type="text/javascript" src="jsLer/ext-base-debug.js"></script>
<!-- ENDLIBS -->
<script type="text/javascript" src="jsLer/ext-all-debug.js"></script>
<script type="text/javascript" src="jsLer/paging.js"></script>
<link rel="stylesheet" type="text/css" href="cssLer/grid-examples.css" />
</head>
<body>

<h1>Paging Grid Example</h1>
<p>This example shows how to create a grid with paging. This grid uses a ScriptTagProxy to fetch cross-domain
remote data (from the Ext forums).</p>
<p>Note that the js is not minified so it is readable. See <a href="jsLer/paging.js">paging.js</a>.</p>

<div id="topic-grid"></div>

</body>
</html>

layout-browser.js

......
treePanel.on('click', function(n){
...
Ext.getCmp('content-panel').load(n.attributes.divAdi + '.aspx');
...



i've changed "loadScripts : false" to "true" in ext-all-debug.js but nothing has changed.

fay
3 Mar 2010, 8:11 AM
Zamkinos,

Have you tried loading a "simpler" page - with minimal information - in layout-browser.js and then build up from there to see what is causing the problem? For a start you should not include ext-all-debug.js in each of the aspx pages. This is the approach I would start with...

RE: Private Messaging.

I appreciate what it's like when your new to something and trying to figure out a problem, but you probably should give it a few days for the forum to respond to you, and if it doesn't you can just "bump" your topic, before PMing someone... twice in the one day! C'mon man... I don't work for ExtJS and just contribute whenever I've a bit of spare time. If you're really stuck you should think about a Support Subscription (http://www.extjs.com/store/extjs/#support-table).