+ }, null, {buffer:1500});
+
+ // Set up our event for updating the word/char count
+ Ext.getCmp('word-textarea').on(event, function(comp){
+ var v = comp.getValue(),
+ wc = 0,
+ cc = v.length ? v.length : 0;
+
+ if (cc > 0) {
+ wc = v.match(/\b/g);
+ wc = wc ? wc.length / 2 : 0;
+ }
+ wordCount.update('Words: ' + wc);
+ charCount.update('Chars: ' + cc);
+ }, null, {buffer: 1});