I did a tab-like thing on my new project at
http://simplefoodie.com/iphone
Login with:
[email protected]
111111
In the grocery list. It is a bit of a breakaway within iui, as it
loads in a view, and I use JS to make the content switchover by
redrawing all the children LI's within my div tag.
I had to do it weird, as moving nodes around requires that the source
cannot be left alone.
function redraw(viewtype){
var gmenu = document.getElementById("glmenu");
var spans = gmenu.childNodes; var gpick;
for(var c=0; c < spans.length; c++) {
if(spans[c].id){
gpick = document.getElementById(spans[c].id);
if(spans[c].id == viewtype+"S")
gpick.setAttribute("picked", "true");
else
gpick.setAttribute("picked", "false");
}
}
var workarray = new Array();
var strarr = document.getElementById(viewtype == "byToGet" ?
"byAlpha" : viewtype);
var temparr = strarr.getAttribute("title");
// console.log(" temparr is a string... " +temparr );
workarray = temparr.split("|");
if(viewtype == "byToGet"){
var getw = new Array(); var gotw = new Array();;
for (var i=0; i<workarray.length; i++) {
if(getCookie(workarray[i]) == 'true')
gotw = gotw.concat(workarray[i]);
else
getw = getw.concat(workarray[i]);
}
workarray = getw.concat(gotw);
}
// now that we have new array, let's see how it intersects with old.
var children;
var orig = new Array();
var drop = new Array();
var thesource = document.getElementById( "GLall" );
var theparent = document.getElementById( "GLguts" );
if (theparent.hasChildNodes()) {
// Get all children of node
children = theparent.childNodes;
// Loop through the children
for(var c=0; c < children.length; c++) {
// console.log(children[c].id + " is removed or replaced
as ID of
current list " );
drop[children[c].id] = children[c].id;
//console.dir(orig[children[c]]);
}
}
var newele;
var newclaim;
for (var i=0; i<workarray.length; i++) {
if(children){
for(var c=0; c < children.length; c++) {
if(workarray[i] == children[c].id){
drop[children[c].id] = false;
break;
}
}
}
newele = document.getElementById( workarray[i] );
// console.log(workarray[i] + " is new item. Elements are... " +
newele.id);
// console.log(newele.id);
theparent.appendChild(newele);
}
for (i in drop){
// console.log(i + " is a drop if not false ... " + drop[i]);
if(drop[i] != false){
newele = document.getElementById( drop[i] );
thesource.appendChild(newele);
}
}
}
On Jun 2, 9:54 am, Sean Gilligan <[email protected]> wrote:
> utahgolfer wrote:
> > Hi, all.
> > i am using the iUI framework to build a simple web app. All works
> > fantastically until i get to a static page that needs to have tabs on
> > it. I can get only part of the content to display.
>
> It always helps to provide a link to your work-in-progress.
>
> > That part that is
> > "selected=true". I basically need to have tab functionality within
> > the content on the static page.
>
> I'm not sure what you mean by a 'static page'. It can be a little
> confusing in iUI because the source code uses the word 'page' to refer
> to what the iPhone SDK would call a 'view'. So the iUI source code
> refers to the <div> and <ul> sections that slide in and out as pages.
> Not only is the word 'page' confusing in this context, but the static
> vs. dynamic distinction can be applied on the server-side or on the
> client-side. Since iUI pages use DHTML and AJAX I would call them
> dynamic pages even if they are 'static HTML' from the server-side
> perspective.
>
> In any event, iUI does not currently include support for tabs. If
> anyone has added tabs to iUI, I'd love to see there work and, of course,
> contributions are welcome.
>
> -- Sean
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---