PDA

View Full Version : Fullscreen textareafield for Sencha Touch 2



subimage
11 Sep 2012, 5:32 PM
I really dislike the default textarea field, so I went looking for alternatives.

I found one called "BetterTextArea" that displayed a larger text field in a modal, but found that a bit wonky. http://colinramsay.co.uk/diary/2012/05/18/a-better-textareafield-for-sencha-touch-2/

I took that code and modified it to display fullscreen when you tap to edit the textfield, which feels better on the phone and my tablet.

Here's the result of my work if anyone cares: https://gist.github.com/3703512
(https://gist.github.com/3703512)
38606

mitchellsimoens
13 Sep 2012, 6:48 AM
Nice! I would make one change. Currently you use Ext.Viewport and add and set the panel as active item. This is assuming the user isn't doing any removal on old items on Ext.Viewport and also that Ext.Viewport is a card layout container. Instead, I would use a sheet and animate it from the bottom

subimage
13 Sep 2012, 4:18 PM
Nice! I would make one change. Currently you use Ext.Viewport and add and set the panel as active item. This is assuming the user isn't doing any removal on old items on Ext.Viewport and also that Ext.Viewport is a card layout container. Instead, I would use a sheet and animate it from the bottom

Good call. Mind modifying the gist to illustrate the point? Just spent about 20 minutes here trying to change it to a sheet, but could not get the sheet to display fullscreen with the "fullscreen: true" config.

lincon6
13 Sep 2012, 5:38 PM
Good call. Mind modifying the gist to illustrate the point? Just spent about 20 minutes here trying to change it to a sheet, but could not get the sheet to display fullscreen with the "fullscreen: true" config.
Try this config to make sheet fullscreen:

{ left: 0
,right: 0
,bottom: 0
,layout: 'fit'
}

mitchellsimoens
14 Sep 2012, 5:08 AM
Use the stretchX and stretchY configs

subimage
14 Sep 2012, 2:36 PM
This worked...here's the updated version: https://gist.github.com/3703512

Thanks for the feedback guys. Should I log a bug that the "fullscreen" config that's documented on sheets doesn't work?