PDA

View Full Version : Cell editing not working



halcwb
9 Nov 2013, 1:51 PM
Somehow I don't get cell editing working in my code. If I run exactly the same test code in a fiddle like below:

1fq

it works fine. But if I run copy paste it and use it in my project, cell editing fails. The cell editing plugin gets created, but somehow no editors get created. Also when adding the below code:


Ext.ComponentQuery.query('cell-editing')[0].plugins[0].on('beforeedit', function () { console.debug('cell editing before event'); })

works with the Ext cell editing example, works with the in the fiddle, but not using the same code in my project. I am at a loss what is going on. The grid in my projects resides in a container with a border layout.

P.s. I checked the existence for editor configs on the columns, they do exist. I tried the code in Chrome, strangely, the editing worked for a short while, after a first try and then stopped working??? Cleared the cache, same problem, cell editing not getting triggered anymore?????????

halcwb
9 Nov 2013, 2:52 PM
Setting collapsed to false on the collapsible grid panel solved the problem. However, either I am doing something stupid or it is a bug. In the last case (also in the first) I am not too happy about this as I lost precious hours in trying to solve this problem.

scottmartin
11 Nov 2013, 12:01 PM
Ext.ComponentQuery.query('cell-editing')[0].plugins[0].on('beforeedit'

That sure is a busy approach to get access. Have you tried assigning it to a variable, or just using something like



grid.getPlugin('mycellediting'); // assign plugin id when creating plugin




buildPlugins : function () {
return [
{
ptype : 'cellediting',
pluginId : 'mycellediting',
}
]
},

halcwb
12 Nov 2013, 12:38 AM
That sure is a busy approach to get access. Have you tried assigning it to a variable, or just using something like



grid.getPlugin('mycellediting'); // assign plugin id when creating plugin




buildPlugins : function () {
return [
{
ptype : 'cellediting',
pluginId : 'mycellediting',
}
]
},


The access is not the issue, the access was just quick and dirty to check the plugin. I do not need to access the plugin at all, I just use the events to get to the required objects/data.

The problem is that editors are not created for columns when the grid is on a collapsed panel. So, then the cell editing is not working. Thats the issue. I tried assigning a pluginId, but that did not resolve the problem. The only way to avoid is, is to set collapsed to false on the container of the grid. But I think this is a bug.

scottmartin
12 Nov 2013, 5:12 AM
I can appreciate your position, but since you cannot duplicate this on a fiddle, then there is another problem.

I would try the following:

-remove the custom UX from the mix .. test with a textfield
-check for any custom overrides that may be causing this to break
-verify your version and make sure you are not using CSS from older version
-break the code down to simplest form and just try to isolate the problem.
-you store array is suspect: store: [[]], are you assigning this later?

If you have something we can look at that duplicates the problem, it would be much easier.

halcwb
12 Nov 2013, 8:30 AM
I can appreciate your position, but since you cannot duplicate this on a fiddle, then there is another problem.

I would try the following:

-remove the custom UX from the mix .. test with a textfield
-check for any custom overrides that may be causing this to break
-verify your version and make sure you are not using CSS from older version
-break the code down to simplest form and just try to isolate the problem.
-you store array is suspect: store: [[]], are you assigning this later?

If you have something we can look at that duplicates the problem, it would be much easier.

I already have gone through all the steps you mention. No luck, also I tried to reproduce the problem in the fiddle, no luck. I have updated the fiddle by putting the grid in a container that is collapsed, but in the fiddle this causes not the same problem as in my project code.

halcwb
12 Nov 2013, 8:50 AM
It's definitely a bug, I have reproduced the problem by setting the above fiddle to Ext version 4.2.0 (the one I am using currently). Adding a record to the store with the grid initially collapsed, and you see what I mean, just run the fiddle in version 4.2.0. Setting the fiddle to a later version, and the editors show up.

scottmartin
12 Nov 2013, 3:45 PM
There does seem to be a bug related to cellediting on a collapsed panel. There is a similar issue related to cellediting on a collapsed fieldset

Here are a few recommended changes as well; there were some quirky artifacts when expanding your example on the south region .. not rendering correctly and header remained at bottom



Ext.define('PrescriptionList', {
extend: 'Ext.grid.Panel',
alias: 'widget.prescriptionlist',

title: '',

initComponent: function() {
var me = this;

Ext.applyIf(me, {
tools: [{
xtype: 'tool',
type: 'save',
handler: function (e, target, owner, me) {
var store = me.up('panel').store;
console.debug(store);
store.add(['']);
store.sync();
}
}],

selModel: {
selType: 'cellmodel'
},

store: [ ],

plugins : [{
ptype: 'cellediting', // lazy load as well
clicksToEdit: 1
}],

columns: [{
dataIndex: 'Generic',
header: 'Generic',
editor: {
xtype: 'textfield'
}

}, {
dataIndex: 'Concentration',
header: 'Concentration',
editor: {
xtype: 'textfield' // shorten code for now
}
}]
});

this.callParent();
}
});

Ext.define('My.Viewport', {
extend: 'Ext.container.Viewport',

layout: 'border',

initComponent: function() {
var me = this;

// removed unused regions
Ext.applyIf(me, {
items: [{
title: 'South',
region: 'south',
collapsed: true,
collapsible: true,
// needs a height
height: 200,
split: true,
items: [{
xtype: 'prescriptionlist'
}]
}, {
title: 'Center',
region: 'center'
// flex: 1 // not needed on center
}]
});

me.callParent(arguments);
}

});

Ext.application({
name: 'Fiddle',

launch: function() {
Ext.create('My.Viewport', {
// renderTo: Ext.getBody() // not needed on viewport
});
}
});


I would highly recommend upgrade to our latest version as there were many fixes

Scott.

halcwb
12 Nov 2013, 11:45 PM
There does seem to be a bug related to cellediting on a collapsed panel. There is a similar issue related to cellediting on a collapsed fieldset

Here are a few recommended changes as well; there were some quirky artifacts when expanding your example on the south region .. not rendering correctly and header remained at bottom

I would highly recommend upgrade to our latest version as there were many fixes

Scott.

Unfortunately, I do not have access to your latest version, i.e. bug fixes. So, for now I will live with it. The code in the fiddle is not production code and changing a customized field to a regular text field is just not an option for my application.

I hope that the latest more bug free version is released to the general public. Is there any indication when this will be done? I am working on an open source project, so, I just do not have the funding to get a payed prescription to your framework.

halcwb
13 Nov 2013, 11:51 AM
There does seem to be a bug related to cellediting on a collapsed panel. There is a similar issue related to cellediting on a collapsed fieldset

Here are a few recommended changes as well; there were some quirky artifacts when expanding your example on the south region .. not rendering correctly and header remained at bottom


I would highly recommend upgrade to our latest version as there were many fixes

Scott.

I am sorry, but this was not a good advice, therefore, -1.

I upgraded to 4.2.1.833 (the latest I can get my hands on) and immediately ran into major rendering issues I did not have in the previous 4.2.0.633 version. The grouping feature (I heavily rely on was broken), see the reported bug (http://www.sencha.com/forum/showthread.php?264947) on this. This was reported in May, about half a year ago. Furthermore, rendering of form fields in nested fieldset layouts are broken. I did update the reference to the 4.2.1.833 css file.

Am I overlooking the obvious (in which case you can give me the -1;-) or should I wait for the public release of 4.2.2?

scottmartin
13 Nov 2013, 12:10 PM
As mentioned, your original layout had some issues. Did you see the changes?

Many users encounter layout issue when then upgrade due to bad design. This was common for many users when upgrading from 4.07.

The bug you mentioned has been fixed in 4.2.2 in reviewing the notes

Affects Version/s: 4.2.0.663
Fix Version/s: 4.2.2.1144



Am I overlooking the obvious (in which case you can give me the -1;-)

These are different issues .. and I just do not see the need.

halcwb
13 Nov 2013, 12:40 PM
As mentioned, your original layout had some issues. Did you see the changes?

Many users encounter layout issue when then upgrade due to bad design. This was common for many users when upgrading from 4.07.

The bug you mentioned has been fixed in 4.2.2 in reviewing the notes

Affects Version/s: 4.2.0.663
Fix Version/s: 4.2.2.1144


These are different issues .. and I just do not see the need.

I am very sorry, but this is a fruitless discussion. By identifying the bug we ruled out that 'issues in the original layout' was the source of the problem, being:

-remove the custom UX from the mix .. test with a textfield
-check for any custom overrides that may be causing this to break
-verify your version and make sure you are not using CSS from older version
-break the code down to simplest form and just try to isolate the problem.
-you store array is suspect: store: [[]], are you assigning this later?

The Ux was not the problem, I did not use any custom overrides (exactly for the reason that it could break things), I made sure I was not using the old version and I did isolate the problem. And of course I do not use empty arrays as stores (although this should be entirely possible, not useful). And finally, the fix is in the latest version only accessible by not even buying a license but by buying full support! That's not going to help me.

Also what you completely fail to realize is that breaking code down to the simplest form is something you do when you develop. If you upgrade the framework and each time you have to break down your code, that's just not going to work. I do create lots of tests, for my code not for the framework code, the responsibility of the framework.

scottmartin
13 Nov 2013, 1:56 PM
You have a nice day!

Scott.

halcwb
13 Nov 2013, 4:21 PM
You have a nice day!

Scott.

I hope you mean it, but thanks ;-)

halcwb
18 Nov 2013, 1:25 PM
I am sorry, but this was not a good advice, therefore, -1.

I upgraded to 4.2.1.833 (the latest I can get my hands on) and immediately ran into major rendering issues I did not have in the previous 4.2.0.633 version. The grouping feature (I heavily rely on was broken), see the reported bug (http://www.sencha.com/forum/showthread.php?264947) on this. This was reported in May, about half a year ago. Furthermore, rendering of form fields in nested fieldset layouts are broken. I did update the reference to the 4.2.1.833 css file.

Am I overlooking the obvious (in which case you can give me the -1;-) or should I wait for the public release of 4.2.2?

After some digging and debugging I found out that trailing return characters were causing the problem in 4.2.1, while in 4.2.0 this did not seem to matter.

In the end, I was able to upgrade and I was wrong with my initial impression that 4.2.1 caused more problems than 4.2.0. In fact this is not the case and 4.2.1 is definitely faster (in my app) than 4.2.0.