Threaded View

  1. #1
    Sencha User
    Join Date
    Nov 2010
    Vote Rating
    paipai is on a distinguished road


    Default Grid column renderer with html tag

    In my app I use grid column renderer with <span> tag inside to display a default value with a different color than the value set by the user. It works fine in 4.0.7.

    In 4.1b1 when the user wants to set the date the default value is not replaced by the date field. The date field is displayed after the default value.

    Full code:


    <html><head> <link rel="stylesheet" type="text/css" href="../../js/ext4/resources/css/ext-all.css"></head><body> <script type="text/javascript" src="../../js/ext4/ext.js"></script> <script type="text/javascript"> // When readyExt.onReady(function () { Ext.require(''); Ext.require('Ext.grid.Panel'); Ext.require('Ext.grid.plugin.CellEditing'); Ext.create('', { storeId:'simpsonsStore', fields:['name', 'email', 'date'], data:{'items':[ { 'date': 'Lisa', "email":"", "date":"" }, { 'name': 'Bart', "email":"", "date":"" }, { 'name': 'Homer', "email":"", "date":"" }, { 'name': 'Marge', "email":"", "date":"" } ]}, proxy: { type: 'memory', reader: { type: 'json', root: 'items' } }, selType: 'cellmodel' });Ext.create('Ext.grid.Panel', { title: 'Simpsons', store:'simpsonsStore'), columns: [ { header: 'Name', dataIndex: 'name', field: 'textfield' }, { header: 'Email', dataIndex: 'email', flex: 1, field: 'textfield' }, { header: 'Date', dataIndex: 'date', field: 'datefield', renderer: function(value, metaData, record) { return value?value:'<span style="color: red">no date</span>'; } } ], height: 200, width: 400, renderTo: Ext.getBody(), plugins: [ Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }) ]});}); </script></body></html>

    Attached Images

Thread Participants: 1