May 03, 2011, 8:24 PM
[CLOSED] GridPanel / Renderer : Property "undefined"?
Hey,
im trying to get an image in a column based on a value in the record. But its not working.
I get an undefined error: "Cannot read property 'Type' of undefined" . What am I missing in here?
im trying to get an image in a column based on a value in the record. But its not working.
I get an undefined error: "Cannot read property 'Type' of undefined" . What am I missing in here?
// .... js
var companyRenderer = function (value, record) {
var tpl = "<img src='{0}' />";
alert(record.data.Type); // ERROR: Cannot read property 'Type' of undefined
};
// ....
<ext:GridPanel ID="GridPanel1" runat="server" Title="asd" AutoHeight="true">
<Store>
<ext:Store ID="Store1" runat="server" >
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="Type"></ext:RecordField>
<ext:RecordField Name="Customer"></ext:RecordField>
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column DataIndex="Type" Width="16">
<Renderer Fn="companyRenderer"/>
</ext:Column>
<ext:Column Header="Cust" DataIndex="Customer"/>
</Columns>
</ColumnModel>
</ext:GridPanel>
Last edited by Daniil; May 04, 2011 at 5:59 AM.
Reason: [CLOSED]