var
kind = require('enyo/kind'),
Button= require('enyo/Button'),
Input=require('moonstone/Input'),
Image=require('enyo/Image');
var BodyText = require('moonstone/BodyText'),
Component = require('enyo/Component');
input2=kind({
name : 'MediaItem',
kind : Button,
classes : 'repeater-item class1 item',
style : "width:150px;height:100px;margin-bottom:250px;",
published : {
mediaImgUrl : ''
},
create : function(){
this.inherited(arguments);
this.colorChanged();
},
components : [
{ kind: Image, name: 'title'},
{ kind:BodyText, name: 'thumbnail',content:'heloooooo'}
],
bindings: [
{from: 'mediaImgUrl', to: '$.thumbnail.content'},
// console.log("bining in top")
],
handlers: {
ontap: 'goToShow'
},
goToShow : function(sender, ev){
this.log("Sender: "+sender.name);
element='';
},
});
module.exports = kind({
name: "MediaItemSample",
components: [
{kind: input2},
{kind:Input, name: 'inputImageSrc',value:'zahra', placeholder: 'Thumbnail URL'},
],
Show : function(sender, ev){
myVar='hhhh'
// this.log("Sender: "+sender.name);
},
bindings: [
{from: '$.inputImageSrc.value', to: '$.mediaItem.mediaImgUrl', oneWay: false},
// console.log("bottom biiindiiing ")
]
});
i want to bind value of myVar from a "Show" function to element of goToShow function .It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
MediaItemSample
. But, what you probably want to do is, in the Show method, is call theset()
method on theinput2
'smediaImgUrl
property.