<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>YourHelpCenter.de &#187; Ext JS</title>
	<atom:link href="http://www.yourhelpcenter.de/category/ext-js/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yourhelpcenter.de</link>
	<description>Hilfe, Lösungen &#38; Support für IT Probleme</description>
	<lastBuildDate>Sun, 05 Feb 2012 21:06:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>ExtJS: Lösung für Fehlermeldung &#8220;this.items.items[0] is undefined&#8221;</title>
		<link>http://www.yourhelpcenter.de/2011/12/extjs-losung-fur-fehlermeldung-this-items-items0-is-undefined/</link>
		<comments>http://www.yourhelpcenter.de/2011/12/extjs-losung-fur-fehlermeldung-this-items-items0-is-undefined/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 19:56:41 +0000</pubDate>
		<dc:creator>Günther</dc:creator>
				<category><![CDATA[Ext JS]]></category>
		<category><![CDATA[beheben]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[errror]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[fehler]]></category>
		<category><![CDATA[field.isValid is not a function]]></category>
		<category><![CDATA[isValid]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[prüfung]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[sourcecode]]></category>
		<category><![CDATA[this.items.items[0] is undefined]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[validierung]]></category>

		<guid isPermaLink="false">http://www.yourhelpcenter.de/?p=2021</guid>
		<description><![CDATA[Die folgende Fehlermeldung tritt in einer ExtJS Anwendung häufig dann auf, wenn in einem Form-Element andere Elemente (wie z.Bsp. ein &#8220;Ext.grid.Grid&#8221;) eingebaut sind: this.items.items[0] is undefined Im folgenden Beispiel finden Sie in der 4. Zeile (&#8220;isFormField: true&#8221;) die Lösung für das Problem: 1 2 3 4 5 6 7 items: &#91;new Ext.grid.GridPanel&#40;&#123; id: &#34;testGrid&#34;, autoScroll: [...]]]></description>
			<content:encoded><![CDATA[<p>Die folgende Fehlermeldung tritt in einer ExtJS Anwendung häufig dann auf, wenn in einem Form-Element andere Elemente (wie z.Bsp. ein &#8220;Ext.grid.Grid&#8221;) eingebaut sind:</p>
<pre>
this.items.items[0] is undefined
</pre>
<p>Im folgenden Beispiel finden Sie in der 4. Zeile (&#8220;isFormField: true&#8221;) die Lösung für das Problem:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">  items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    id<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;testGrid&quot;</span><span style="color: #339933;">,</span>
    autoScroll<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
    isFormField<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
    height<span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span><span style="color: #339933;">,</span>
    width<span style="color: #339933;">:</span> <span style="color: #CC0000;">400</span><span style="color: #339933;">,</span>
    columns<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span></pre></td></tr></table></div>

<p>Gehen Sie in Ihrem JS (JavaScript) Quellcode in das Nicht-Form-Element und fügen Sie die Zeile dort ein.</p>
<p>Sollten Sie das Element mit dem Formular auf Gültigkeit testen wollen (Validierung), dann benötigen Sie zusätzlich noch die Funktion &#8220;isValid&#8221; innerhalb des Elementes. Ansonsten erhalten Sie ggf. diese Fehlermeldung:</p>
<pre>
field.isValid is not a function
</pre>
<p>Am Beispiel des oberen &#8220;Ext.grid.GridPanel&#8221; hier der JavaScript Code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">  items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    id<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;testGrid&quot;</span><span style="color: #339933;">,</span>
    autoScroll<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
    isFormField<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
    height<span style="color: #339933;">:</span> <span style="color: #CC0000;">200</span><span style="color: #339933;">,</span>
    width<span style="color: #339933;">:</span> <span style="color: #CC0000;">400</span><span style="color: #339933;">,</span>
    columns<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>...<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
    isValid<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #006600; font-style: italic;">// check ...</span>
      <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Fügen Sie Ihre Prüfungen in Zeile 9 ein und entscheiden Sie durch Ihre Prüfungen, ob das Element gültig ist oder nicht. Dabei können Sie z.Bsp. abfragen, ob mindestens eine Zeile im Grid ausgewählt wurde:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">  isValid<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> Ext.<span style="color: #660066;">getCmp</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;testGrid&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">selModel</span>.<span style="color: #660066;">selections</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.yourhelpcenter.de/2011/12/extjs-losung-fur-fehlermeldung-this-items-items0-is-undefined/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ExtJS: Fehler &#8220;unterminated string literal&#8221; bei .load()</title>
		<link>http://www.yourhelpcenter.de/2010/02/extjs-fehler-unterminated-string-literal-bei-load/</link>
		<comments>http://www.yourhelpcenter.de/2010/02/extjs-fehler-unterminated-string-literal-bei-load/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 06:46:35 +0000</pubDate>
		<dc:creator>Jockel</dc:creator>
				<category><![CDATA[Allgemeines]]></category>
		<category><![CDATA[Ext JS]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[#10]]></category>
		<category><![CDATA[#13]]></category>
		<category><![CDATA[chr(13)]]></category>
		<category><![CDATA[CR LF]]></category>
		<category><![CDATA[don't stop]]></category>
		<category><![CDATA[endless]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[ewig]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[fehler]]></category>
		<category><![CDATA[linebreak]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[new line]]></category>
		<category><![CDATA[runs]]></category>
		<category><![CDATA[unterminated string literal]]></category>
		<category><![CDATA[zeilenumbruch]]></category>
		<category><![CDATA[\n]]></category>

		<guid isPermaLink="false">http://www.yourhelpcenter.de/?p=839</guid>
		<description><![CDATA[Wenn Sie auf Ihrer Webseite mit Ext JS und der Funktion &#8220;xyz.open()&#8221; Daten nachladen, kann es vorkommen, dass Ihre Maske die Daten nicht zeigt und der Ladevorgang nicht beendet wird. Sie sehen dann (sofern Sie es aktiviert haben) die Lademeldung weiterhin auf dem Bildschirm. Die Meldung in der Fehlerkonsole des Browsers lautet (z.Bsp.): Fehler: unterminated [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn Sie auf Ihrer Webseite mit <a title="Ext JS Source" href="http://www.extjs.com/" target="_blank">Ext JS</a> und der Funktion &#8220;xyz.open()&#8221; Daten nachladen, kann es vorkommen, dass Ihre Maske die Daten nicht zeigt und der Ladevorgang nicht beendet wird. Sie sehen dann (sofern Sie es aktiviert haben) die Lademeldung weiterhin auf dem Bildschirm.</p>
<p>Die Meldung in der Fehlerkonsole des Browsers lautet (z.Bsp.):</p>
<p>Fehler: unterminated string literal<br />
Quelldatei: http://localhost/ext/ext-all.js<br />
Zeile: 7, Spalte: 73<br />
Quelltext:<br />
({&#8220;count&#8221;:1,&#8221;success&#8221;:true,&#8221;items&#8221;:[{&#8220;id&#8221;:1234,&#8221;ref&#8221;:&#8221;",&#8221;txt&#8221;:&#8221;Shell</p>
<p>Grund für den Fehler ist dann meist ein Zeilenumbruch (CRLF) im Text (hier in der Variablen &#8220;txt&#8221;).</p>
<p>Diesen umbruch kann das JSON Format zwar an Ihre Anwendung übertragen, JavaScript kommt damit dann aber nicht zurecht.</p>
<p><strong>Lösung:</strong></p>
<p>Ersetzen Sie bei der JSON Erstellung (z.Bsp. in PHP) den Umbruch durch ein &#8220;\n&#8221;:</p>
<p><code>eregi_replace(chr(13).chr(10),'\n',$to-&gt;Text)</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yourhelpcenter.de/2010/02/extjs-fehler-unterminated-string-literal-bei-load/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

