PDA

View Full Version : textarea as tag box



randielCoder
13 Dec 2011, 9:59 PM
I want create a textarea for a user... when the user write a word and press spacebar the word should convert to a cloud in a div with close button. Do i use a renderTpl or i can write some code alternative? this is my code:


panel = Ext.create('Ext.panel.Panel', {
renderTo: Ext.getBody(),
title: 'Prueba de editor de texto',
width: 600,
bodyPadding: 10,
layout: 'anchor',
items: [
{
xtype:'textarea',
fieldLabel: 'Keywords',
grow: true,
id: 'txtTagger',
anchor: '100%',
renderTpl: tpl,
enableKeyEvents: true,
listeners: {
keypress: function(e, el){
if (el.getKey()==32) {
aStr = e.getValue().split(" ");
vTag = aStr[aStr.length-1];
// add a div with vTag value in textarea
}
}
}
}
]
});

Thank you for your help !

mitchellsimoens
14 Dec 2011, 9:01 AM
Please post in the appropriate forum. I have moved this to the Ext JS 4 Q&A forum for you.