PDA

View Full Version : Notes sample app


ABC123

GTGeek88
05-25-2013, 11:36 AM
Alpha has provided the code for the Notes sample app and I was looking at it today. I was interested in the "Hamburger" button at the top left that displays in iPhone mode. Its job is to slide the list of boards in from the left so that the user can select a different one. The problem is that I can see no settings or code that make this work. I've tried it in Live Preview and it's working, but I'm just not seeing how to get that done.

Russell

Davidk
05-25-2013, 02:57 PM
The Panel Card "Boards" is not seen when the apps starts... it has a Dock property setting of "auto-collapse-before". The button "Boards" found in the Container "BoardsDockCont", which has an ID of "BOARDSDOCK", defines two images to be used... css/NotesApp/iconBoardsOff.png and css/NotesApp/iconBoardsOn.png... one for unpressed, one for pressed.

The Panel Layout "Main" has a property called "Docked Panel Controller Buttons". This property sets the relationship between the "BOARDSDOCK" button and the "BOARDS" panel.

When the "Boards" button is pressed the Notes Panel Card flows off to the right revealing the "Boards" Panel Card. Main has Layout flow direction of Left-to-right.

I hope I have that right.

GTGeek88
05-25-2013, 06:00 PM
Well, I see that now and have arranged things as close as I can, but the panel card that should be doing the auto-collapse-before is showing itself from the very start and I end up with a split screen. That card is to the left and the main panel is to the right.

Davidk
05-25-2013, 09:22 PM
Panels are going to be a wee bit tough to troubleshoot... they're so advanced. In Notes, Boards panel size is set to 280px. The Notes minimum panel size is set to 300px.

[Edit] The Boards Panel is set to auto-collapse-before, it gets docked... or hidden... because both panels cannot be displayed in the same space. If the size settings are not in place, then Alpha figures out the sizes, splits the panels and auto-collapse-before does not have to happen. Since both panels are almost the same size... the width of the screen, then the auto-collapse-before kicks in.

So... are your two panel cards using the same size properties as Notes, and in the same way?

The only other thing I can suggest is to zip and post your UX and I'll have a look.

gregincolumbus
05-26-2013, 09:21 AM
Hi Russell

Where did you find the code for the Notes app? I have been looking for it but have not had any success....thanks

GTGeek88
05-28-2013, 10:12 PM
Sorry for the slow response. I'm on vacation.

http://www.ajaxvideotutorials.com/V12Videos/Notes.zip

GTGeek88
05-28-2013, 10:29 PM
David-

I just blew away what I had and simplified and got it working properly in iPhone vertical mode, though the button is a little different looking than in the Notes app (it has a frame or line around it and it kind of highlights when you put the mouse over it, but the Notes app does not do that and that's not really expected behavior in a mobile app).

Now I have to figure out how to make it do the same thing in iPad horizontal mode. I don't want the slide in panel always visible. The app I am working on will be displaying quite a bit of data so even on the iPad in horizontal mode, I'll want to have all that screen real estate instead of having that left panel always visible.

Bill Griffin
05-29-2013, 07:21 AM
Hi Russell

Where did you find the code for the Notes app? I have been looking for it but have not had any success....thanks

Greg
Check the release notes. There are 8 videos as well as a component download.

gregincolumbus
05-29-2013, 08:29 AM
Thanks Bill....that is very helpful!

GTGeek88
05-29-2013, 08:31 AM
I posted a link last night to the code. It appears Alpha deleted it.

Davidk
05-29-2013, 08:57 AM
Russell,

I think what would be really helpful is if you post a video of your app running and explain what you'd like to have happen with the panels. I know it's a pain but it really helps to point out what you'd like to have happen. I find when you enter the world of panels that, literally, anything goes... you can do anything you want.

GTGeek88
05-29-2013, 09:33 AM
If I don't have it working, I can't post a video on it. :-)

It's simple. I want the slide in panel like Notes has for the Boards panel. But I never want it visible, regardless of device or orientation, until the hamburger button is used.

Davidk
05-29-2013, 10:24 AM
I think the Panel Layout panel is getting in your way. It's amazing if you need to adjust associated panel displays depending on screen real estate... but in your case you want a simple hide and show on demand.

Try this on a test copy of the notesApp UX.

1. Delete the Panel Layout panel... just the two controls that define the layout.
2. Move the 3 controls of the Notes panel above the Boards panel
3. On the Button:Boards button (found in the Container:BOARDSDOCKCONT), IN the onClick event, put this code...


if ({dialog.object}.panelGetActive()=="BOARDS"){
{dialog.object}.panelSetActive('NOTES',true);
}
else
{
{dialog.object}.panelSetActive('BOARDS',true);
}

So now... the Notes panel will display... because it's first in line. And when you click the "Hamburger" button the Boards panel will slide into view. Clicking the "Hamburger" button again will slide the Notes panel into view.

You can move, duplicate, the Heading of the Navigator Panel if you want, to give each of the Panels their own heading etc. You'd have to duplicate the Hamburger button, and then you wouldn't need to "if" code. You'd just set the active panel for each of the two buttons.