paipai
6 Jan 2012, 1:18 AM
Hello,
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.
http://www.sencha.com/forum/attachment.php?attachmentid=30497&d=1325841340
Full code:
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.data.Store'); Ext.require('Ext.grid.Panel'); Ext.require('Ext.grid.plugin.CellEditing'); Ext.create('Ext.data.Store', { storeId:'simpsonsStore', fields:['name', 'email', 'date'], data:{'items':[ { 'date': 'Lisa', "email":"lisa@simpsons.com", "date":"" }, { 'name': 'Bart', "email":"bart@simpsons.com", "date":"" }, { 'name': 'Homer', "email":"home@simpsons.com", "date":"" }, { 'name': 'Marge', "email":"marge@simpsons.com", "date":"" } ]}, proxy: { type: 'memory', reader: { type: 'json', root: 'items' } }, selType: 'cellmodel' });Ext.create('Ext.grid.Panel', { title: 'Simpsons', store: Ext.data.StoreManager.lookup('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>
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.
http://www.sencha.com/forum/attachment.php?attachmentid=30497&d=1325841340
Full code:
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.data.Store'); Ext.require('Ext.grid.Panel'); Ext.require('Ext.grid.plugin.CellEditing'); Ext.create('Ext.data.Store', { storeId:'simpsonsStore', fields:['name', 'email', 'date'], data:{'items':[ { 'date': 'Lisa', "email":"lisa@simpsons.com", "date":"" }, { 'name': 'Bart', "email":"bart@simpsons.com", "date":"" }, { 'name': 'Homer', "email":"home@simpsons.com", "date":"" }, { 'name': 'Marge', "email":"marge@simpsons.com", "date":"" } ]}, proxy: { type: 'memory', reader: { type: 'json', root: 'items' } }, selType: 'cellmodel' });Ext.create('Ext.grid.Panel', { title: 'Simpsons', store: Ext.data.StoreManager.lookup('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>