PDA

View Full Version : [OPEN] [FIXED][3.0.0] Important bug in Ext.grid.TemplateColumn



jthevenoux
8 Jul 2009, 11:25 PM
Ext version tested:

Ext 3.0.0
Browser versions tested against

IE8

FF3 (firebug 1.3.5.0 installed)Operating System

WinXP Pro
Description
templatecolumn doesn't work .Possible fix
In src\widgets\grid\Column.js, line 377
var tpl = typeof Ext.isObject(this.tpl) ? this.tpl : new Ext.XTemplate(this.tpl);
var tpl = Ext.isObject(this.tpl) ? this.tpl : new Ext.XTemplate(this.tpl);

evant
8 Jul 2009, 11:28 PM
Fixed in the trunk, thanks.

ValterBorges
22 Feb 2010, 7:27 PM
I'm having a similar issue with 3.1.1 and IE8 Comboboxes. Works fine in firefox 3.6

If I set IE8 to IE7 compatability mode then it works fine.

ext-all-debug.js breaks in the overwrite method on the line 774 call to this.applyTemplate(values).

Is there a temporary fix / override for this while we wait for 3.1.2?

the tpl property looks like:


tpl: '<tpl for="."><div ext:qtip="{fieldA}" class="x-combo-list-item" style="text-align:left;">{fieldB}</div></tpl>'

evant
22 Feb 2010, 7:29 PM
Please provide a simple test case we can use.

ValterBorges
18 Mar 2010, 1:08 PM
In 2.3.0 this works! in 3.1.2 this fails. Just change the lib between 2.3 and 3.1.2 to see the issue.

The problem was that you can no longer pass an empty store and then data in the data field.

By putting the data in the store data property instead resolved the problem.

Maybe something should be added in the docs or faq to say the two are not compatible.




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
<head>
<title>ComboBox Sample</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=us-ascii" />
<meta name="description" content="TITLE" />
<meta name="keywords" content="TITLE" />
<meta name="robots" content="index, follow" />
<link rel="stylesheet" type="text/css" href="../cdn/js/ext/ext-2.3.0/resources/css/ext-all.css" />
<!-- First of javascript includes must be an adapter... -->
<script type="text/javascript" src="../cdn/js/JQuery/JQuery-1.4.2/jquery-1.4.2.js"></script>
<script type="text/javascript" src="../cdn/js/ext/ext-2.3.0/adapter/ext/ext-base.js?v=mjm"></script>
<!-- ...then you need the Ext itself, either debug or production version.-->
<script type="text/javascript" src="../cdn/js/ext/ext-2.3.0/ext-all-debug.js?v=mjm"></script>
<script type="text/javascript">
$(document).ready(function() {

Ext.BLANK_IMAGE_URL = '../cdn/js/ext/ext-2.3.0/resources/images/default/s.gif';

var reader = new Ext.data.ArrayReader(
{
fields: Ext.data.Record.create([
{ name: 'id', type: 'string' },
{ name: 's_desc', type: 'string' },
{ name: 'm_desc', type: 'string' },
{ name: 'l_desc', type: 'string' }
])
}
);

var store = new Ext.data.Store({ reader: reader, data: [['a', 'b', 'c', 'd']] });

var combo = new Ext.form.ComboBox({
renderTo: 'diCombo'
,store:store
, data: [['a', 'b', 'c', 'd']]
, mode: 'local'
, tpl: '<tpl for="."><div ext:qtip="<B>{s_desc}</B>-{l_desc}" class="x-combo-list-item" style="text-align:left;">{m_desc}</div></tpl>'
});
});

</script>
</head>
<body>
<div>
<form id="form1" method="post" action="" name="form1">
<div>
<div>
<div>
<div id="diCombo"></div>
</div>
</div>
</div>
</form>
</div>
</body>
</html>

ValterBorges
19 Mar 2010, 7:21 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
<head>
<title>ComboBox Sample</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=us-ascii" />
<meta name="description" content="TITLE" />
<meta name="keywords" content="TITLE" />
<meta name="robots" content="index, follow" />
<link rel="stylesheet" type="text/css" href="../cdn/js/ext/ext-3.1.2/resources/css/ext-all.css" />
<!-- First of javascript includes must be an adapter... -->
<script type="text/javascript" src="../cdn/js/JQuery/JQuery-1.4.2/jquery-1.4.2.js"></script>
<script type="text/javascript" src="../cdn/js/ext/ext-3.1.2/adapter/ext/ext-base.js?v=mjm"></script>
<!-- ...then you need the Ext itself, either debug or production version.-->
<script type="text/javascript" src="../cdn/js/ext/ext-3.1.2/ext-all-debug.js?v=mjm"></script>
<script type="text/javascript">
$(document).ready(function() {

Ext.BLANK_IMAGE_URL = '../cdn/js/ext/ext-3.1.2/resources/images/default/s.gif';

var reader = new Ext.data.ArrayReader(
{
fields: Ext.data.Record.create([
{ name: 'id', type: 'string' },
{ name: 's_desc', type: 'string' },
{ name: 'm_desc', type: 'string' },
{ name: 'l_desc', type: 'string' }
])
}
);

var store = new Ext.data.Store({ reader: reader, data: [['a', 'b', 'c', 'd']] });

var combo = new Ext.form.ComboBox({
renderTo: 'diCombo'
,store:store
, data: [['a', 'b', 'c', 'd']]
, mode: 'local'
, tpl: '<tpl for="."><div ext:qtip="<B>{s_desc}</B>-{l_desc}" class="x-combo-list-item" style="text-align:left;">{m_desc}</div></tpl>'
});
});

</script>
</head>
<body>
<div>
<form id="form1" method="post" action="" name="form1">
<div>
<div>
<div>
<div id="diCombo"></div>
</div>
</div>
</div>
</form>
</div>
</body>
</html>