HTML调用Extjs中方法
createPanel: function () {
var me = this;
var mainPanel = Ext.create('Ext.Panel', {
fullscreen: true,
cls: 'main-bg',
items: [{
renderTo: 'my-demo',
xtype: 'panel',
width: 850,
height: 500,
html: me.rowRender(data, 3, 2, 40, 30)
}]
});
},
test:function()
{
alert(1);
},
rowRender: function (data, rows, columns, width, height) {
var me = this;
var tempCount = 0;
for (var i = 0; i < data.length; i++) {
tempCount++;
str += '<input onclick="里面如何调用test方法" type="text" style="background-color:' + data[i].color + ';border-bottom:' + data[i].bottomLine + ' solid black;border-top:' + data[i].topLine + ' solid black;border-left:' + data[i].bottomLine + ' solid black;border-right:' + data[i].rightLine + ' solid black; width:' + width + 'px;height:' + height + 'px;" value=' + data[i].value + '></input>';
}
return str;
}