PDA

View Full Version : List from JSON with a textbox & a splitter - How to? Need you help, please...



nir.elbaz
24 Mar 2011, 1:15 PM
Hi everyone,
I'm a newbie here, so any help would be great..

I want to build a page which looks like the screenshot below - a list (the grouping is a nice-to-have) from database with a textbox and two buttons for increasing / decreasing the number in the textbox.

Could you guys help me and explain which control is the right one for this task?
A sample code would be great - thanks in advance!

25332

d5chris
24 Mar 2011, 1:53 PM
A List will do the trick nicely and will do your groupings and the a-z on the right hand side.
You'll just need to put the code for your + and - in your itemTpl and you're good to go.

nir.elbaz
25 Mar 2011, 12:04 AM
Thanks, Chris!


Can I add sencha controls to the tmpl, like textarea, or should I use simple HTML tags (like input for image button and textbox, in my case)?
If adding sencha controls to templates is possible, could you please explain how?
The problem with using a list is that every time I tap on a row, it is being selected, even if click on a control (e.g. button) inside this row. Is there a way to avoid this behavior?

Thanks again.

d5chris
25 Mar 2011, 12:12 AM
1 - Thats a good question! I've often wondered if thats possible. To my knowledge, no. However if i'm wrong it'd be great...
2 - You can use an itemtap listener to remove the selection as soon as it is set (search my posts here to see how to do that) - however there'll be the selection flash while their finger is down. To totally remove that, you could either:
a: Add a CSS rule so that the 'active' state doesn't look any different
b: Disallow selections by deleting the selection model - i *think* you can do this with code like so: myList.selModel = false

Cheers