PDA

View Full Version : Sencha Fiddle - Is it really using the Ext 6 GPL version ?



mrinsan
23 Nov 2015, 11:50 PM
I am trying to reproduce a bug in Sencha Fiddle using Ext 6.0.0.640 - GPL but it looks like it dosent use that.

I tried printing Ext.versions.classic.version in sencha fiddle and dosent work

Now to report the bug which i have with ExtJs rowbody feature i created a fiddle.

it do not work as expected , rason being I am using a method thats available in 6.0.0.640 - setupRowData() (Sencha Fiddle - Line 94) - it should work as I selected Ext 6 version from the Framework dropdown.

if i replace this method with getAdditionalData() it works, but this is available only in Ext 6.0.1 not in Ext 6.0

so now i am confused which version of ExtJs is sencha fiddle using ?

https://fiddle.sencha.com/#fiddle/11i0 (https://fiddle.sencha.com/#fiddle/11i0)

Gary Schlosberg
24 Nov 2015, 6:16 PM
Thanks for the report. As I understand it, Fiddle should be using 6.0.0 commercial. Do you think that it's a different version?

As far as the bug, it would be best to submit a ticket in the Ext JS 6 Bugs forum. I should mention that the setupRowData() method is private so generally it should not be extended or overridden since it could change in future versions.

mitchellsimoens
25 Nov 2015, 6:11 AM
Gary is correct, Fiddle is only using commercial builds. We currently are not pushing the GPL licensed builds of Ext JS 6 to CDN and therefore Fiddle is using the commercial licensed builds. Technically speaking, the GPL and commercial builds should be equivalent, the commercial doesn't have any extra features or anything over the GPL build.

mrinsan
30 Nov 2015, 3:11 PM
I should mention that the setRowData() method is private so generally it should not be extended or overridden since it could change in future versions.

However docs of Ext 6.0 shows an example at the top of the page that tells its user how to use setupRowData().
http://docs.sencha.com/extjs/6.0/6.0.0-classic/#!/api/Ext.grid.feature.RowBody

and anyways the method dont work on sencha fiddle with Ext 6.0 framework. But the 6.0 GPL version that I use works but has bugs

Docs of 6.0.1 changed the example in the docs and suggested to use getAdditionalData() method insted

This works in Sencha Fiddle with Ext 6.0 framework selected? is it really using 6.0 then ?

6.0 GPL version that I use dont recognize this menthod


So my question remains the same regardless of commercial/gpl version
sencha fiddle and the Ext 6.0 dont behave the same

is the Ext 6.0 commercial is different than Ext 6.0 GPL ?

mitchellsimoens
30 Nov 2015, 3:33 PM
is the Ext 6.0 commercial is different than Ext 6.0 GPL ?

no, they are the same.

mrinsan
1 Dec 2015, 1:37 PM
no, they are the same.

well then followup question will be why they behave differently.
Sencha fiddle With Ext 6.0.0 dont function like the way it is mentioned in Sencha 6.0.0 docs it behaves like Sencha 6.0.1 docs ?

Is it a documentation bug or a sencha fiddle issue ? also i have to mention that the GPL version that i downloaded works as per the Sencha 6.0.0 docs

so can someone clarify where is the disconnect ?

mitchellsimoens
2 Dec 2015, 7:00 AM
I would say the documentation for 6.0.0 that uses setupRowData was wrong. In fact, the change was due to EXTJS-10921 which was a documentation bug (filed internally). So the recommended means of doing what you want is to use the getAdditionalData method in both 6.0.0 and 6.0.1 except our 6.0.0 docs had a wrong example.

mrinsan
2 Dec 2015, 2:09 PM
So the recommended means of doing what you want is to use the getAdditionalData method in both 6.0.0 and 6.0.1 except our 6.0.0 docs had a wrong example.

In that case Ext 6.0.0 GPL is different from the Ext 6.0.0 commercial. Coz getAdditionalData dont work in Ext 6.0.0 GPL but the setupRowData() do work

can I assume that from your statement ?

mitchellsimoens
2 Dec 2015, 2:29 PM
I just ran a test locally (outside of fiddle) using both 6.0.0.640 GPL and commercial and the following code (what you have with your fiddle except using the getAdditionalData) and both license builds are working exactly the same:


Ext.define('testApp.store.Orders', {
extend: 'Ext.data.TreeStore',
fields: [
{name: 'name' },
{name: 'amount'},
{name: 'status'},
{name: 'comments'}
],

root: {
expanded: true,
children: [
{
name :'Order 1',
amount :'10',
status :'pending',
children: [
{
leaf : true,
name :'Item 1',
amount :'7',
status :'shipped',
comments:'Item have been shipped'
},
{
leaf : true,
name :'Item 2',
amount :'3',
status :'pending',
comments:'Item not available at the moment'
}
]
},
{
name :'Order 2',
amount :'10',
status :'In Transit',
children: [
{
leaf : true,
name :'Item 3',
amount :'7',
status :'shipped',
comments:'2 items shipped'
},
{
leaf : true,
name :'Item 4',
amount :'3',
status :'shipped',
comments:'2 Items shipped'
}
]
},
{
name :'Order 3',
amount :'10',
status :'pending',
children: [
{
leaf : true,
name :'Item 4',
amount :'7',
status :'shipped',
comments:'Item have been shipped'
},
{
leaf : true,
name :'Item 5',
amount :'3',
status :'pending',
comments:'Item not available at the moment'
}
]
}

]
}
});


Ext.define('testApp.view.main.Main', {
extend: 'Ext.container.Container',
xtype: 'app-main',

items: [
{
xtype: 'treepanel',
store: Ext.create("testApp.store.Orders"),
features: [{
ftype: 'rowbody',
getAdditionalData: function (data, idx, record, orig) {
if(record.get("comments")){
return {
rowBody: '<div style="padding: 1em">' + record.get("comments") + '</div>'
};
}
}
}],
columns: [
{
xtype : 'treecolumn',
text : 'Name',
dataIndex: 'name',
width : 250
},
{
text : 'Amount',
dataIndex: 'amount',
width : 100
},
{
text : 'Status',
dataIndex: 'status',
width : 150
},
],
}

]

});


Ext.application({
name: 'testApp',
launch: function() {
Ext.create("testApp.view.main.Main", {
renderTo: Ext.getBody()
});
}
});

mrinsan
2 Dec 2015, 3:50 PM
hmm, thats strange.
let me try at my end on a freshly downloaded 6.0.0.640 GPL build and update you on my findings

mrinsan
10 Dec 2015, 8:14 AM
very strange

I tried to use getAdditionalData in commercial and nightly(dec/8) builds and it didnt worked, however setupRowData works

the only thing thats different in my fiddle example was, i was extending the treepanel and including the feature config block. and then I am using the extended class in my MVVM structure.

after browsing through the source i found the below



/**
* @method getAdditionalData
* @protected
* @template
* Provides additional data to the prepareData call within the grid view.
* The rowbody feature adds 3 additional variables into the grid view's template.
* These are `rowBody`, `rowBodyCls`, and `rowBodyColspan`.
*
* - **rowBody:** *{String}* The HTML to display in the row body element. Defaults
* to *undefined*.
* - **rowBodyCls:** *{String}* An optional CSS class (or multiple classes
* separated by spaces) to apply to the row body element. Defaults to
* {@link #rowBodyCls}.
* - **rowBodyColspan:** *{Number}* The number of columns that the row body element
* should span. Defaults to the number of visible columns.
*
* @param {Object} data The data for this particular record.
* @param {Number} idx The row index for this record.
* @param {Ext.data.Model} record The record instance
* @param {Object} orig The original result from the prepareData call to massage.
* @return {Object} An object containing additional variables for use in the grid
* view's template
*/

/*
* @private
*/
setupRowData: function(record, rowIndex, rowValues) {
if (this.getAdditionalData) {
Ext.apply(rowValues, this.getAdditionalData(record.data, rowIndex, record, rowValues));
}
}



and I am not sure how this.getAdditionalData is resolved. can you point me to the source of getAdditionalData in ExtJs source ?

mitchellsimoens
10 Dec 2015, 9:46 AM
By default, there is no getAdditionalData, that's why there is an if conditional in setupRowData to check for it's existence. If you provide it in your code, then it will be used otherwise setupRowData won't do anything.

mrinsan
10 Dec 2015, 11:26 AM
By default, there is no getAdditionalData, that's why there is an if conditional in setupRowData to check for it's existence. If you provide it in your code, then it will be used otherwise setupRowData won't do anything.

thanks for clarifying that, will do further investigation why thats behaving differently in my local source