PDA

View Full Version : Minified JS



tina@user
21 Jul 2015, 10:57 PM
I have a application developed in extjs 4.1.3.

this project has been minified and upgraded to extjs 4.2
As a result my code is not working...to be precise renderer function of grid is not geeting executed..

I dnt see any error..Can anyone plz guide me from where shoud i start to debug in order to rectify?

Its urgent!!

Plz help!
Thanx in advance!

jdkhamba
22 Jul 2015, 3:29 AM
Well to start with I wouldn't debug the minified code but the un-minified one by trying to make it work with 4.2 version(use ext-all-debug that comes with the SDK). That should point you in the right direction.

tina@user
22 Jul 2015, 8:24 PM
Well to start with I wouldn't debug the minified code but the un-minified one by trying to make it work with 4.2 version(use ext-all-debug that comes with the SDK). That should point you in the right direction.


I replaced the ext-all-debug file in my workspace....and i found the problem is with the row expander plugin which i was working perfectly fine in extjs 4.1.3.

(I am using using it for 'Show more' and 'show less' feature in my grid panel wherein the data is populated using tpl)

i had overriden the plugin as follows:-



Ext.Loader.setPath('Ext.ux', 'StaticContent/extjs/examples/ux');
Ext.define('Cms.ux.plugin.RowExpander', {
extend: 'Ext.ux.RowExpander',
// pluginId: 'ux-rowexpander',
pluginId: 'ux-rowexpander',

alias: 'plugin.ux-rowexpander',

expandOnDblClick: false,
expandOnEnter:false,

rowBodyTpl: [
'<div class="text-wrapper-expanded">' +
'<div class="news-data">' +
'<div class="news-content">',
'<div class="news-paragraph" id="post-content-expanded{id}">{content}<span class="news-toggle collapse">See less</span></div>',
/*'<div class="post-bottom-container">'+
'<div class="like">'+
'<img class="img-thumbnail likeImg" title="like" id="likeImgExpanded{id}" src="{likeSourceUrl}" /><span id="likeCountExpanded{id}"> {likeCount}</span> Likes'+
'</div>'+
'<div id="{id}" class="comment" title="view comments" >'+
'<img class="img-thumbnail text-right" src="/cms/resources/images/comment.png"/>'+
'<span id=commentCountExpanded-{id} class="commentCount">{commentCount}</span><span> Comment</span>'+
'</div>'+
'</div>'+*/
'<div class="clear"></div>'+
'</div>' +
'</div>' +
'<div>'
],


// don't add the expander +/- because we will use a custom one instead
addExpander: Ext.emptyFn,

addCollapsedCls: {
fn: function(out, values, parent) {
var me = this.rowExpander;


if (!me.recordsExpanded[values.record.internalId]) {
values.itemClasses.push(me.rowCollapsedCls);
} else {
values.itemClasses.push('x-grid-row-expanded');
}
this.nextTpl.applyOut(values, out, parent);
},


syncRowHeights: function(lockedItem, normalItem) {
this.rowExpander.syncRowHeights(lockedItem, normalItem);
},


// We need a high priority to get in ahead of the outerRowTpl
// so we can setup row data
priority: 20000
}
});




when i replace the extjs 4.1.3 row expander plugin (as it has been deprecated )with that of extjs 4.2..
It works but alignment and everything else in the rowBodtTpl is lost.

Anything else i need to look into?
Plz guide!!
Thanx!