-
4 Aug 2008 11:20 AM #1
why methods are not getting called?
why methods are not getting called?
Can someone help me figure out why my methods are not getting called? I get the error "XML filtering predicate operator called on incompatible Function" and don't know what this really means.
part of my code
com.vignette.portal.vapRibbonDataListTab = function(arguments){
Ext.apply(this, arguments);
var gridViewId = arguments.gridId;
var thumnailViewId = arguments.dataViewId;
this.topToolbar = new Ext.Toolbar({
items: ['->',{
text: "Thumbnail View"
,handler: function(){
this.hideGrid.(Ext.getCmp(gridViewId).getEl()); not getting called
this.showThumbnails(Ext.getCmp(thumnailViewId).getEl()); not getting called
}
,scope: this
}, '-',
{
text: "List View"
,handler: function(){
//TODO: obtain dtaview object
Ext.getCmp(thumnailViewId).getEl().fadeOut({
endOpacity: 0
,easing: "easeOut"
,duration: .5
,remove: false
,useDisplay: false
});
Ext.getCmp(gridViewId).getEl().fadeIn({
endOpacity: 1
,easing: "easeOut"
,duration: .5
});
}
}]
});
/*this.gridView = new Ext.grid.GridPanel({
});*/
//TODO: replace with json object
this.storeDataRecord = new Ext.data.Record.create([
{
name: "description"
,type: "string"
}, {
name: "title"
,type: "string"
}, {
name: "UID"
,type: "string"
}, {
name: "previewURL"
,type: "string"
}
]);
this.dbStore = new Ext.data.Store({
data: arguments.storeData
,reader: new Ext.data.JsonReader({
totalProperty: 25
}, this.storeDataRecord)
});
this.pagingBar ={
xtype: "paging"
,border: false
,pageSize: 25
,store: this.dbStore
,displayInfo: true
,displayMsg: "Displaying skins {0} - {1} of {2}"
,emptyMsg: "No skins to display"
};
this.searchBar = {
xtype: "vapSearchField"
,store: this.dbStore
}
this.bottomToolbar = new Ext.Toolbar({
items: [this.pagingBar, '-', 'Search:']
});
this.thumbnailListView = new Ext.DataView({
//public properties
id: thumnailViewId
,autoHeight: true
,displayMode: "display"
,frame: false
,itemSelector: "div.dvItemSelector"
,overClass: "x-view-over"
,selectedClass: 'x-view-selected'
,tpl: '<tpl for=".">' +
'<div class="dvItemSelector" id=\"{UID}\">' +
"<img src=\"{previewURL}\" alt=\"{title}\" width=\"100\" height=\"100\" />" +
"<div><h4>{title}</h4><p>{description}</p></div>" +
'</div>' +
'</tpl>' +
'<div class=\"x-clear\"></div>'
,emptyText: "Dataview was unable to retrieve any data"
,loadingText: "Please wait. Loading data..."
,store: this.dbStore
,singleSelect: true
,listeners: {
click: function(dataview, nodeIndex, htmlNode, e){
console.log("click event executed.");
//Ext.Ajax.request({url: '/portal/rest/skinservice/pages/' + site + '/' + dataview.getSelectedNodes()[0].id});
//siteTree.show(htmlNode);
//this.showNavTree(dataview, '/portal/rest/skinservice/setSkin/');
}
//,render: initializeDataViewDragZone
}
});
this.gridListView = new Ext.grid.GridPanel({
id: gridViewId
,store: this.dbStore
,columns:[
{id: "title", header: "Title", width: 150, sortable: true, dataIndex: "title"}
,{header: "description", width: 150, sortable: true, dataIndex: "description"}
]
,viewConfig: {forceFit: true}
,stripeRows: true
,autoExpandColumn: "title"
,hideMode: "display"
,height: 250
});
com.vignette.portal.vapRibbonDataListTab.superclass.constructor.call(this, {
autoScroll: true
,layout: "fit"
,plain: true
,tbar: this.topToolbar
,items: [this.thumbnailListView, this.gridListView] //, this.gridView
,bbar: [this.bottomToolbar, this.searchBar]
});
};
Ext.extend(com.vignette.portal.vapRibbonDataListTab, Ext.Panel, {
//TODO: replace with json object
//storeData: null
title: "don't need this tab"
,showGrid: function(gridToShow){
gridToShow.fadeIn({
endOpacity: 1
,easing: "easeOut"
,duration: .5
});
}
,hideGrid: function(gridtoHide){
gridtoHide.fadeOut({
endOpacity: 0
,easing: "easeOut"
,duration: .5
,remove: false
,useDisplay: false
});
}
,showThumbnails: function(thumbToShow){
thumbToShow.fadeIn({
endOpacity: 1
,easing: "easeOut"
,duration: .5
});
}
,hideThumbnails: function(thumbToHide){
thumbToHide.fadeOut({
endOpacity: 0
,easing: "easeOut"
,duration: .5
,remove: false
,useDisplay: false
});
}
});
-
4 Aug 2008 11:36 AM #2
Why dot before parens this.hideGrid()
Found with : http://jslint.comCode:this.hideGrid.(Ext.getCmp(gridViewId).getEl()); not getting called
Next time please post code in code tags (# on editor ).
-
4 Aug 2008 11:45 AM #3
Carol, I don't understand your question "Why dot before parens this.hideGrid()". this.hideGrid takes one parameter which is the html Element "Ext.getCmp(gridViewId).getEl()".
I pasted my code using code tags
Code:com.vignette.portal.vapRibbonDataListTab = function(arguments){ Ext.apply(this, arguments); var gridViewId = arguments.gridId; var thumnailViewId = arguments.dataViewId; this.topToolbar = new Ext.Toolbar({ items: ['->',{ text: "Thumbnail View" ,handler: function(){ this.hideGrid.(Ext.getCmp(gridViewId).getEl()); this.showThumbnails(Ext.getCmp(thumnailViewId).getEl()); } ,scope: this }, '-', { text: "List View" ,handler: function(){ //TODO: obtain dtaview object Ext.getCmp(thumnailViewId).getEl().fadeOut({ endOpacity: 0 ,easing: "easeOut" ,duration: .5 ,remove: false ,useDisplay: false }); Ext.getCmp(gridViewId).getEl().fadeIn({ endOpacity: 1 ,easing: "easeOut" ,duration: .5 }); } }] }); /*this.gridView = new Ext.grid.GridPanel({ });*/ //TODO: replace with json object this.storeDataRecord = new Ext.data.Record.create([ { name: "description" ,type: "string" }, { name: "title" ,type: "string" }, { name: "UID" ,type: "string" }, { name: "previewURL" ,type: "string" } ]); this.dbStore = new Ext.data.Store({ data: arguments.storeData ,reader: new Ext.data.JsonReader({ totalProperty: 25 }, this.storeDataRecord) }); this.pagingBar ={ xtype: "paging" ,border: false ,pageSize: 25 ,store: this.dbStore ,displayInfo: true ,displayMsg: "Displaying skins {0} - {1} of {2}" ,emptyMsg: "No skins to display" }; this.searchBar = { xtype: "vapSearchField" ,store: this.dbStore } this.bottomToolbar = new Ext.Toolbar({ items: [this.pagingBar, '-', 'Search:'] }); this.thumbnailListView = new Ext.DataView({ //public properties id: thumnailViewId ,autoHeight: true ,displayMode: "display" ,frame: false ,itemSelector: "div.dvItemSelector" ,overClass: "x-view-over" ,selectedClass: 'x-view-selected' ,tpl: '<tpl for=".">' + '<div class="dvItemSelector" id=\"{UID}\">' + "<img src=\"{previewURL}\" alt=\"{title}\" width=\"100\" height=\"100\" />" + "<div><h4>{title}</h4><p>{description}</p></div>" + '</div>' + '</tpl>' + '<div class=\"x-clear\"></div>' ,emptyText: "Dataview was unable to retrieve any data" ,loadingText: "Please wait. Loading data..." ,store: this.dbStore ,singleSelect: true ,listeners: { click: function(dataview, nodeIndex, htmlNode, e){ console.log("click event executed."); //Ext.Ajax.request({url: '/portal/rest/skinservice/pages/' + site + '/' + dataview.getSelectedNodes()[0].id}); //siteTree.show(htmlNode); //this.showNavTree(dataview, '/portal/rest/skinservice/setSkin/'); } //,render: initializeDataViewDragZone } }); this.gridListView = new Ext.grid.GridPanel({ id: gridViewId ,store: this.dbStore ,columns:[ {id: "title", header: "Title", width: 150, sortable: true, dataIndex: "title"} ,{header: "description", width: 150, sortable: true, dataIndex: "description"} ] ,viewConfig: {forceFit: true} ,stripeRows: true ,autoExpandColumn: "title" ,hideMode: "display" ,height: 250 }); com.vignette.portal.vapRibbonDataListTab.superclass.constructor.call(this, { autoScroll: true ,layout: "fit" ,plain: true ,tbar: this.topToolbar ,items: [this.thumbnailListView, this.gridListView] //, this.gridView ,bbar: [this.bottomToolbar, this.searchBar] }); }; Ext.extend(com.vignette.portal.vapRibbonDataListTab, Ext.Panel, { //TODO: replace with json object //storeData: null title: "don't need this tab" ,showGrid: function(gridToShow){ gridToShow.fadeIn({ endOpacity: 1 ,easing: "easeOut" ,duration: .5 }); } ,hideGrid: function(gridtoHide){ gridtoHide.fadeOut({ endOpacity: 0 ,easing: "easeOut" ,duration: .5 ,remove: false ,useDisplay: false }); } ,showThumbnails: function(thumbToShow){ thumbToShow.fadeIn({ endOpacity: 1 ,easing: "easeOut" ,duration: .5 }); } ,hideThumbnails: function(thumbToHide){ thumbToHide.fadeOut({ endOpacity: 0 ,easing: "easeOut" ,duration: .5 ,remove: false ,useDisplay: false }); } });
-
4 Aug 2008 11:48 AM #4
Carol, never mind. I noticed the "." you talked about.
Thanks!


Reply With Quote