PDA

View Full Version : [CLOSED] Uncaught Error: Syntax error, unrecognized expression: li.\



hdsoso
Jun 07, 2014, 3:30 PM
http://forums.ext.net/attachment.php?attachmentid=12311&stc=1


<ext:DataView ID="DataView1" runat="server" ItemSelector="ul.sc_case"
EmptyText="<li>暂无数据</li>">
<Store>
<ext:Store runat="server" ID="store1" OnReadData="LoadCases" PageSize="6">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="id"></ext:ModelField>
<ext:ModelField Name="name"></ext:ModelField>
<ext:ModelField Name="img"></ext:ModelField>
<ext:ModelField Name="info"></ext:ModelField>
<ext:ModelField Name="price"></ext:ModelField>
</Fields>
</ext:Model>
</Model>
<Proxy>
<ext:PageProxy></ext:PageProxy>
</Proxy>
</ext:Store>
</Store>
<Tpl ID="Tpl1" runat="server">
<Html>
<tpl for=".">
<li class="picUl-son">
<div class="pic"><a href="#?id={id}" title="fdfdfdf"><img src="{img}" width="196" height="146" alt="{name}" class="PicAuto" style="padding: 0px;"/></a></div>
<div class="text"><a href="#?id={id}" title="{name}">{name}</a></div>
</li>
</tpl>
</Html>
</Tpl>
</ext:DataView>



what's the meaning of

<tpl for=".">

ItemSelector="ul.sc_case"
what cause the error:Uncaught Error: Syntax error, unrecognized expression: li.\
http://forums.ext.net/attachment.php?attachmentid=12321&stc=1

Daniil
Jun 09, 2014, 12:21 PM
what's the meaning of

<tpl for=".">

It means that it iterates a data array which is loaded by Store.

More information about Template syntax you can find here.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.XTemplate



what's the meaning of

ItemSelector="ul.sc_case"


It is best to start with a doc article.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.view.AbstractView-cfg-itemSelector



what cause the error:Uncaught Error: Syntax error, unrecognized expression: li.\
http://forums.ext.net/attachment.php?attachmentid=12321&stc=1

I could not reproduce that with your piece of code and I don't quite have any ideas what might be wrong. Please provide a full test case.