PDA

View Full Version : Need help for cell editing



bee
9 Sep 2011, 11:55 PM
Hi I am using cell editing for panel (keeping concept of editor grid panel in mind), I have one column comes from database and other are local column and those values are storing in the database. But when I load the panel those empty column gave some html code like
<div unselectable="on" class="x-grid-cell-inner x-unselectable" style="; text-align: left;" id="ext-gen1636">&nbsp;</div>
so I put some default value . Now the problem is when I enter data to empty field then all other fields get updated auto matically. I am sure what is the main reason behind this. DO I need to use some renderer there ?
See the screen shot below

27991

ValterBorges
10 Sep 2011, 7:02 AM
Show you gridpanel,store,proxy,model definitions.

bee
10 Sep 2011, 8:54 PM
Ext.define('Modelname', {
extend: 'Ext.data.Model',
fields: [{name: 'code', type: 'string'},
{name: 'description', type: 'string'}] });
var store= new Ext.data.Store({ model: 'Modelname',
storeId: 'store',
pageSize: 300,
buffered: true,
proxy: { type: 'rest',
startParam : undefined,
limitParam : undefined,
pageParam : undefined,
simpleSortMode : true,
noCache : false,
url : 'xxxxx',
reader: {
type: 'json',
root: 'items'
} },
autoLoad: true,
autoSync : true});

gridPanel = Ext.create('Ext.grid.Panel', {
store : store,
autoHeight : true
, autowidth : true,
layout :'fit',
plugins: [cellEditing],
viewConfig : {forceFit: false},
id : 'grid',
selModel: { selType: 'cellmodel' },
columns :[
{ name : 'id',
width: 100, align: 'left', field: { xtype: 'textfield', itemId : 'id', value : '' } }, { xtype : 'combo', id : 'TypeCombo', name : 'TypeCombo', typeAhead : true, autoSelect : 'true', triggerAction : 'all', store : Store, editable : true, queryMode : 'local', forceSelection : false, emptyText : 'Select ', displayField : 'description', valueField : 'code', renderer : comboBoxRenderer(TypeCombo) } }, { header : 'Number', width: 100, align: 'left', field: { xtype: 'numberfield', value: 1, minValue: 0, maxValue: 100000 } }, { header : ' Date', width : 100, renderer : Ext.util.Format.dateRenderer('d/m/Y'), field: { xtype : 'datefield', format : 'd/m/Y' } }, { header : ' Time', field: { xtype : 'timefield', format : 'H:i' } } ] });

ValterBorges
12 Sep 2011, 10:54 AM
What happens if you give your model an id column?

bee
12 Sep 2011, 9:04 PM
I dont want to give id column for grid..

ValterBorges
13 Sep 2011, 7:43 AM
try it, you can always remove it later.

Where is your model for you grid store?
What are you using for displayfield valuefield of combo?

kgoley
9 Jul 2013, 2:20 AM
I am trying for cell editing in the grid.
But when i click on the cell, just getting the html structure of that cell like-
<div class="x-grid-cell-inner " style="text-align: left; ;"></div>

This problem is only in Firefox.

thalsa
22 Feb 2014, 6:03 PM
I had the same problem with firefox with a column that had an index to a field not present in the model. adding the field to the model fixed the problem.