PDA

View Full Version : Problem with List



jwjames83
23 Aug 2011, 11:16 AM
First off, I'm a complete greenhorn when it comes to Sencha & haven't dabbled with web stuff for about 10+ years, so needless to say - things have changed quite a bit during that time. However, I am a programmer at heart and write code for a proprietary completely control system as my day job.

So - I put together a little thing for our company to where they can check on the status of our systems out there and it works for the most part pretty well. I'm having issues with the List however. It appears to be overflowing the page, meaning the last item is not shown whenever I scroll down to the bottom. If I continue to pull up I can see it, but once I release the second to last aligns perfectly to the bottom.

Here is the list definition:


clientList = new Ext.List({
// use the stored data
store: clientStore,
plugins:clientPull,
grouped:true,
indexBar:true,
scroll: 'horizontal',
// set the list to full screen
fullscreen:true,
layout:'fit',
itemTpl : ["<div class=\"mainDisplay\">{Name}</div><div class=\"infoDisplay\">{Address}</div>"],
listeners:{
itemtap : function(dataview, index, item, e){
// Display the client's information
getClientInfo(index);

clientIndex = index;

// Set the title of the new screen to the client's name
if(clientStore.getAt(index).data.Name.length >= 14)
topClient.setTitle(clientStore.getAt(index).data.Name.substring(0,10)+'...')
else
topClient.setTitle(clientStore.getAt(index).data.Name);

// Set the active tab to Summary
clientPnl.setActiveItem(0);

clients.setActiveItem(clientPnl);
}
}
});


Also, this way of programming Javascript is completely new to me, so sorry if things aren't as efficient as it could be.

jjerome
23 Aug 2011, 12:41 PM
Can you show a picture of this? Are you running it in a browser or stand-alone app?

jwjames83
23 Aug 2011, 1:03 PM
27656
This is in its normal state.

27657
This is in its pulled state. Obviously there's a record that's not being shown in the normal state.

As I said, I'm still quite new to this, so it is very possible (if not probable) that I've got something setup wrong. Just curious if anyone has seen an issue like this and if so, what did you do to correct it? I'm assuming it's something to do with the cards within panels, and all that stuff. I can post more code if need be or at least a summary of how it currently is.

This is my very first web app - so, it's almost an exploratory type program, but with the intent of a functional one for our company. Once I learn more on how things should be done and just learn more in general, I'm sure I'll begin rewriting it to streamline the code and modifying inefficient sections.

Appreciate any advice, suggestions, and thanks for taking time out to reply or even just viewing the thread.

Edit: it appears this way when looking in Safari and as a shortcutted web-app.

jjerome
24 Aug 2011, 4:51 AM
Ive had issues with this and it wasn't my code. I've been testing my applications with an Android Tablet and in the browser there is an addressbar and whatnot. With those bars there, it was pushing my application down (cutting off the bottom of it like you see there).

Now, I'm not sure this is happening here because it's on the iPhone. I believe the problem with the window resizing will be fixed in the next version of Sencha Touch, but like I said, I never experienced it with an iPhone.

Does anyone else have input?

jwjames83
24 Aug 2011, 5:27 AM
Thanks for the reply.

Just for grins I decided to have just my list and nothing else load up - and sure enough, it scrolled how it was supposed to and did not hide the last row, so I'm now convinced it's something with my code.

Now to debug even more . . . too much to do when it's not your full-time job!

I'll try and mark this answered as I've determined it's my own screw-up. :-)

jjerome
24 Aug 2011, 5:30 AM
Good luck!

beetree
11 Sep 2011, 10:12 AM
Thanks for the reply.

Just for grins I decided to have just my list and nothing else load up - and sure enough, it scrolled how it was supposed to and did not hide the last row, so I'm now convinced it's something with my code.

Now to debug even more . . . too much to do when it's not your full-time job!

I'll try and mark this answered as I've determined it's my own screw-up. :-)

Hi,

I'm having the same problem. Did you find what the issue was, or do I have to go through the debugging face myself as it's very app specific?

akinsey
12 Sep 2011, 3:05 PM
I am also having this issue. Any updates?

jwjames83
12 Sep 2011, 3:25 PM
I eventually rewrote my entire program - it was admittedly a "see what I can do with Sencha, then do it how it's supposed to be done" (or at least kinda close to how it should be done) type of project.

I believe I had initially used it within a Panel that was defined within another Panel. On the rewrite, I have only one Panel with a card layout, and that list is a card.

So, to quickly summarize, it WAS like this:


mainPanel w/card layout
|
----> loginPanel w/ fit layout & fullscreen
|
----> clientPanel w/ card layout & fullscreen
|
----> clientList as a card


Now, I have it like this:


mainPanel w/card layout
|
-----> clientList as a card

I have a start() function which is called in the onReady() of Ext.setup. when it's executed I check to see if a cookie has been set. If so, I go ahead and create the mainPanel with the clientList and lists. Otherwise it creates the login panel, and after a successful login, it sets the cookie, and start() is called again, thus creating the mainPanel.

Essentially - I believe I had too many nestings, and in hindsight, it was foolish to only have nested as many panels as I did when they were single items (again, live and learn version). Not saying this is anyone else's problem, but it was mine and as a result I believe it chopped off the last item of my list.

akinsey
12 Sep 2011, 4:34 PM
Thanks for that explanation. After looking at your illustration, I realized I was double nesting my list within the viewport and within another panel for no reason. Once I nested the list directly under the viewport the issue went away.

Thanks again :D