Hey mockware,
Many Thanks for reply. I tried to use your method, but it is still not showing me any results.
I created this in "init.js"
events.handleonSelectView.subscribeTo(KONtx.application, "onShowView");
In screen B - I changed the code as follows:
CODE
var _this;
var elemLen=3;
var SubCatView = new KONtx.Class({
ClassName: 'SubCatView',
Extends: KONtx.system.SidebarView,
config: {
visibleRows: elemLen,
},
createView: function() {
_this = this;
this.controls = {};
var __baseID = (this.id||this.ClassName||this._ktxID+'.CategoryGrid');
var buttonHeight = KONtx.utility.scale(35);
var backButton = new KONtx.control.BackButton({
id: __baseID+'.BackButton',
label: 'Video SubCategory' }).appendTo(this);
this.controls.listGrid = new KONtx.control.Grid({
columns: 1,
rows: this.config.visibleRows,
carousel: true,
cellCreator: this._cellCreator,
cellUpdater: this._cellUpdater,
styles: {
vOffset: backButton.outerHeight,
width: this.width,
height: buttonHeight * this.config.visibleRows
},
manageWaitIndicator: true
}).appendTo(this);
},
_cellCreator: function() {
var cell = new KONtx.control.GridCell({
styles: {
height: KONtx.utility.scale(35),
width: this.width,
},
events: {
onSelect: function(event) {
KONtx.application.loadView("View-C", {
param: this.param,
});
}
}
});
cell.textLabel = new KONtx.element.Text({
styles: {
color: '#FFFFFF',
fontSize: KONtx.utility.scale(18),
hAlign: 'left',
vAlign: 'left',
wrap: true
}
}).appendTo(cell);
return cell;
},
_cellUpdater: function(cell, dataitem) {
cell.textLabel.data = dataitem.label;
cell.param = dataitem.param;
},
handleonSelectView: function(event) {
if (event.payload.viewId === "view-B") {
event.payload.view.selectView();
}
}
});
function selectView(){
..... update function content.
}
It seems that my "onselectView" is not placed at proper place. Could you please rectify it?
my view-B is generated when user clicks on gridCell and "onSelect" event is fired? I am totally confused now. Please guide me.