Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Solution for Ext4:</strong></p> <p>I was looking for a solution for this and this guy said the property grid has this behavior. I have adapted it to work in a clean way for me on initComponent I declared:</p> <pre><code>this.editors = { 'date' : Ext.create('Ext.grid.CellEditor', { field: Ext.create('Ext.form.field.Date', {selectOnFocus: true})}), 'string' : Ext.create('Ext.grid.CellEditor', { field: Ext.create('Ext.form.field.Text', {selectOnFocus: true})}), 'number' : Ext.create('Ext.grid.CellEditor', { field: Ext.create('Ext.form.field.Number', {selectOnFocus: true})}), 'int' : Ext.create('Ext.grid.CellEditor', { field: Ext.create('Ext.form.field.Number', {selectOnFocus: true})}), 'boolean' : Ext.create('Ext.grid.CellEditor', { field: Ext.create('Ext.form.field.ComboBox', { editable: false, store: [[ true, 'Sim' ], [false, 'Não' ]] })}) }; </code></pre> <p>I used these functions to help me (copied):</p> <pre><code>this.renderCell = function(val, meta, rec) { var result = val; if (Ext.isDate(val)) { result = me.renderDate(val); } else if (Ext.isBoolean(val)) { result = me.renderBool(val); } return Ext.util.Format.htmlEncode(result); }; this.getCellEditor = function(record, column) { return this.editors[record.get('type')]; }; </code></pre> <p>And finally, associate these functions to the column:</p> <pre><code>{text: "Valor", name : 'colunaValor', width: 75, sortable: true, dataIndex: 'valor', width:200, renderer: Ext.Function.bind(this.renderCell, this), getEditor: Ext.Function.bind(this.getCellEditor, this) } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload