It's true, I read the Acceptance Criteria when I downloaded everything, but I forgot it... sorry...
I have had a look at the Starting Parametres, but I have some doubts...
- I want to do sth similar to the thing is displayed in the widget gallery example... I have checked the source code there, and I have some doubts I cant understand. Here they are
CODEBOX
cellCreator: function () {
return new $wg.views.WidgetCell({
events: {
onSelect: function (event) {
KONtx.application.loadView('WidgetDetail', {
widget: event.payload.dataItem.widget
});
}
}
});
},
can I just substitute the part of the widget by contact: event.payload.dataItem.contact... and if so, my logical question is of course... where in the code is that widget updated??? because I thought it was in the part of updateContent, where I have found the following
CODEBOX
var base = this.config.baseId,
title = dataItem.widget.title,
author = dataItem.widget.authors[0].author,
icon_src = $wg.API.gallery.getFileLink(dataItem.widget, 'icon'),
version = dataItem.widget.version,
install_state = dataItem.widget.install_state.status;
// log(dataItem.widget.wid, install_state);
this.widget_name.setText(title);
this.author_name.setText($_(base+'.author_name', author.name));
this.widget_icon.setSource(icon_src);
this.install_badge.setSource($wg.assets[base+'.install_badge.'+install_state]);
but I havent found anything in the code in reference to dataItem.widget.authors[0].author (and the rest of the cases)... where is that array??? Because it seems there is a database, or something like that, but I havent found it!!!!!!
Resuming... I have my listing configured as shows
1. some arrays at the beginning as variables called "names []", "dirs []", "phones []"
2. the initialize function as shown
CODEBOX
initialize: function() {
this.parent();
this.cache.imgData = [
"http://farm4.static.flickr.com/3464/3237417064_50c0815e3b_t.jpg",
"http://farm4.static.flickr.com/3401/3237554258_0aa9b7e0e5_t.jpg",
"http://farm4.static.flickr.com/3263/3236466402_166b392551_t.jpg",
].slice(0,3).map(function(src,i) {
return {src: src,
name: names[i],
label:'Contact: '+ names[i],
phone: phones[i],
dir: dirs[i],
}
});
}, /*
3. I have the CellCreator in the following way...
CODEBOX
var cell = new KONtx.control.GridCell({
events: {
onSelect: function (event){
// var dataItem = this.getDataItem();
// log('selected a cell!',dataItem);
KONtx.application.loadView('DetailContactsView', {
contact: event.payload.dataItem.contact
});
}
}
});
4. I have the UpdatingCell in the following
CODEBOX
imageCellUpdater: function (cell, dataitem) {
cell.pic.src=dataitem.src;
cell.name.data="Contact: " + dataitem.name;
cell.dir.data="Cocina: " + dataitem.dir;
cell.phone.data="Precio: " + dataitem.phone;
},
(the cell.pic, cell.name and so on have been created with its style...)
HOWEVER, I DONT KNOW HOW TO ADAPT THE VIEW UPLOADED ONCE PRESSING "ENTER" IN THE LIST IN A WAY I CAN USE THIS PARAMETERS IN THAT VIEW!!!!!
I really beg you to help me in this task, is kind of urgent, and I really dont know how to do it...